{"id":28174,"library":"segments-ai","title":"Segments.ai Python SDK","description":"Official Python client for the Segments.ai annotation platform. Enables dataset management, sample upload/download, annotation export, and integration with labeling workflows. Current version 1.25.0, release cadence approximately monthly.","status":"active","version":"1.25.0","language":"python","source_language":"en","source_url":"https://github.com/segments-ai/segments-ai","tags":["segments-ai","annotation","dataset","labeling"],"install":[{"cmd":"pip install segments-ai","lang":"bash","label":"default"}],"dependencies":[],"imports":[{"note":"Use explicit import to avoid attribute confusion.","wrong":"import segments","symbol":"SegmentsClient","correct":"from segments import SegmentsClient"},{"note":"Dataset is not exported; use SegmentsDataset.","wrong":"from segments import Dataset","symbol":"SegmentsDataset","correct":"from segments import SegmentsDataset"}],"quickstart":{"code":"from segments import SegmentsClient\nimport os\n\nclient = SegmentsClient(api_key=os.environ.get('SEGMENTS_API_KEY', ''))\n# List datasets\ndatasets = client.get_datasets()\nprint(datasets)","lang":"python","description":"Initialize client and list datasets."},"warnings":[{"fix":"Remove any usage of SegmentsClient with Hugging Face Hub; use direct API key authentication instead.","message":"In version 1.20.0, Hugging Face integration was dropped. Any code relying on huggingface_hub integration will break.","severity":"breaking","affected_versions":"<1.20.0 (removed in >=1.20.0)"},{"fix":"Use `from segments import SegmentsClient` instead of `from segments import Client`.","message":"The `Client` class was renamed to `SegmentsClient` in v1.0.0. `Client` may be removed in future.","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"Implement exponential backoff or limit concurrency. The SDK raises `RateLimitError` (version >=1.20.0).","message":"Rate limiting is enforced. Scripts that make many parallel requests may hit 429 errors.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Run `pip install segments-ai` in your current Python environment.","cause":"Package not installed or installed in a different environment.","error":"ModuleNotFoundError: No module named 'segments'"},{"fix":"Pass a valid API key via `SegmentsClient(api_key='your-api-key')` or set the `SEGMENTS_API_KEY` environment variable.","cause":"Missing or incorrect API key passed to SegmentsClient.","error":"segments.exceptions.AuthenticationError: Invalid API key"},{"fix":"Remove `hub_token` argument. Use `SegmentsClient(api_key=...)` instead.","cause":"Hugging Face Hub token argument is no longer supported as of v1.20.0.","error":"TypeError: __init__() got an unexpected keyword argument 'hub_token'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}