Registry / ai-ml / segments-ai

segments-ai

JSON →
library1.25.0pypypi✓ verified 89d ago

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.

pip install segments-ai
INSTALL
IMPORT
SIG · SEGMENTS-AI
S
segments-ai
ai-mlpythonv1.25.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

SegmentsClient
✓ from segments import SegmentsClient
✗ import segments
Use explicit import to avoid attribute confusion.
SegmentsDataset
✓ from segments import SegmentsDataset
✗ from segments import Dataset
Dataset is not exported; use SegmentsDataset.

Initialize client and list datasets.

from segments import SegmentsClient import os client = SegmentsClient(api_key=os.environ.get('SEGMENTS_API_KEY', '')) # List datasets datasets = client.get_datasets() print(datasets)
Debug
Known issues
breakingIn version 1.20.0, Hugging Face integration was dropped. Any code relying on huggingface_hub integration will break.
fix
Remove any usage of SegmentsClient with Hugging Face Hub; use direct API key authentication instead.
affects: <1.20.0 (removed in >=1.20.0)
deprecatedThe `Client` class was renamed to `SegmentsClient` in v1.0.0. `Client` may be removed in future.
fix
Use `from segments import SegmentsClient` instead of `from segments import Client`.
affects: >=1.0.0
gotchaRate limiting is enforced. Scripts that make many parallel requests may hit 429 errors.
fix
Implement exponential backoff or limit concurrency. The SDK raises `RateLimitError` (version >=1.20.0).
affects: all
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'segments'
Package not installed or installed in a different environment.
fix
Run `pip install segments-ai` in your current Python environment.
segments.exceptions.AuthenticationError: Invalid API key
Missing or incorrect API key passed to SegmentsClient.
fix
Pass a valid API key via `SegmentsClient(api_key='your-api-key')` or set the `SEGMENTS_API_KEY` environment variable.
TypeError: __init__() got an unexpected keyword argument 'hub_token'
Hugging Face Hub token argument is no longer supported as of v1.20.0.
fix
Remove `hub_token` argument. Use `SegmentsClient(api_key=...)` instead.
Upgrade
Version history
1.25.0latest on PyPI · released Apr 9, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
19 hits · last 30 days
node
12
OpenAI (training)
1
Resources
segments-ai — pip install segments-ai · libregistry