JigsawStack Python SDK

0.4.3 · active · verified Fri Apr 17

JigsawStack is a Python SDK providing access to a suite of AI services including computer vision, natural language processing, and speech-to-text. It simplifies integration with the JigsawStack API, offering a client for various AI capabilities. The library is actively maintained with frequent minor releases, currently at version 0.4.3, often including fixes and updates to API response types.

Common errors

Warnings

Install

Imports

Quickstart

Initializes the JigsawStack client using an API key from environment variables and performs a simple object detection task. The `JIGSAWSTACK_API_KEY` must be set for authentication.

import os
from jigsawstack import JigsawStack

# Ensure JIGSAWSTACK_API_KEY is set in your environment
api_key = os.environ.get("JIGSAWSTACK_API_KEY", "")

if not api_key:
    print("Error: JIGSAWSTACK_API_KEY environment variable not set.")
    exit(1)

client = JigsawStack(api_key=api_key)

# Example: Object Detection
try:
    response = client.image.object_detection(
        image_url="https://jigsawstack.io/images/object.jpeg"
    )
    print(f"Object Detection Response Status: {response.status_code}")
    if response.is_success:
        print(response.json())
    else:
        print(f"Error: {response.json()}")
except Exception as e:
    print(f"An error occurred: {e}")

view raw JSON →