{"id":9845,"library":"jigsawstack","title":"JigsawStack Python SDK","description":"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.","status":"active","version":"0.4.3","language":"en","source_language":"en","source_url":"https://github.com/jigsawstack/jigsawstack-python","tags":["AI","SDK","API client","computer vision","natural language processing","speech to text","generative AI"],"install":[{"cmd":"pip install jigsawstack","lang":"bash","label":"Install stable version"}],"dependencies":[{"reason":"Used for data validation and settings management within the SDK.","package":"pydantic","optional":false},{"reason":"Asynchronous HTTP client used for making API requests.","package":"httpx","optional":false},{"reason":"Commonly used for loading environment variables like API keys, though not strictly required by the SDK itself.","package":"python-dotenv","optional":true}],"imports":[{"symbol":"JigsawStack","correct":"from jigsawstack import JigsawStack"}],"quickstart":{"code":"import os\nfrom jigsawstack import JigsawStack\n\n# Ensure JIGSAWSTACK_API_KEY is set in your environment\napi_key = os.environ.get(\"JIGSAWSTACK_API_KEY\", \"\")\n\nif not api_key:\n    print(\"Error: JIGSAWSTACK_API_KEY environment variable not set.\")\n    exit(1)\n\nclient = JigsawStack(api_key=api_key)\n\n# Example: Object Detection\ntry:\n    response = client.image.object_detection(\n        image_url=\"https://jigsawstack.io/images/object.jpeg\"\n    )\n    print(f\"Object Detection Response Status: {response.status_code}\")\n    if response.is_success:\n        print(response.json())\n    else:\n        print(f\"Error: {response.json()}\")\nexcept Exception as e:\n    print(f\"An error occurred: {e}\")","lang":"python","description":"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."},"warnings":[{"fix":"Thoroughly review changelogs and test your code after upgrading, especially for logic dependent on specific response structures or Pydantic models. Consider pinning to exact minor versions.","message":"The library frequently updates API response types and internal data models (e.g., in v0.3.7, v0.4.0, v0.4.3). This can break existing parsing logic or type checks when upgrading.","severity":"breaking","affected_versions":"<=0.4.3"},{"fix":"Ensure the `JIGSAWSTACK_API_KEY` environment variable is correctly set, or pass your API key directly to the `JigsawStack` client constructor: `client = JigsawStack(api_key='YOUR_API_KEY')`.","message":"An API key is mandatory for all requests. Not providing a valid API key will result in authentication errors.","severity":"gotcha","affected_versions":"All"},{"fix":"Upgrade to version 0.3.4 or newer for reliable handling of file uploads and multipart requests, which included a major SDK revamp.","message":"Previous versions (e.g., prior to v0.3.4) had known issues with multipart form requests for file uploads. While fixed, relying on very old versions for file operations is not recommended.","severity":"deprecated","affected_versions":"<0.3.4"},{"fix":"Refer to the latest official documentation or GitHub README for the most up-to-date client usage patterns. If upgrading, carefully check for `AttributeError` or `ModuleNotFoundError`.","message":"As the SDK is under active development, method names, module paths, or available services might change between minor versions, especially during major internal refactors.","severity":"gotcha","affected_versions":"All"}],"env_vars":null,"last_verified":"2026-04-17T00:00:00.000Z","next_check":"2026-07-16T00:00:00.000Z","problems":[{"fix":"Set the `JIGSAWSTACK_API_KEY` environment variable or pass the `api_key` argument directly to the `JigsawStack` constructor: `client = JigsawStack(api_key='YOUR_API_KEY')`.","cause":"The JigsawStack API client was initialized without a valid API key.","error":"jigsawstack.exceptions.AuthenticationError: Missing API key."},{"fix":"Consult the latest documentation for the correct method name and usage. This often occurs after significant SDK revamps like the one in v0.3.4.","cause":"An API method or service name was changed or removed in a newer version of the SDK.","error":"AttributeError: 'JigsawStack' object has no attribute 'old_method'"},{"fix":"Implement robust error handling and null checks when parsing API responses. Review the API documentation for expected response formats and potential error payloads, especially after SDK upgrades that might alter response model types.","cause":"This typically occurs when trying to access a key or index on a response that is `None`, often due to an unexpected API response structure or an error from the API itself.","error":"TypeError: 'NoneType' object is not subscriptable"},{"fix":"Check your internet connection and verify that the JigsawStack API endpoints are reachable. If you're using a custom base URL, ensure it's correct. Temporarily disabling VPN/proxy might help diagnose.","cause":"The SDK could not connect to the JigsawStack API server due to a network issue, incorrect API endpoint, or DNS resolution failure.","error":"httpx.ConnectError: [Errno -2] Name or service not known"}]}