Skip to main content

Python SDK for the Unitlab.ai data annotation platform

Project description



PyPI Python Downloads License

Unitlab.ai is an AI-driven data annotation platform that automates the collection of raw data, facilitating collaboration with human annotators to produce highly accurate labels for your machine learning models. With our service, you can optimize work efficiency, improve data quality, and reduce costs.

Unitlab Python SDK

Python SDK and CLI for the Unitlab.ai data annotation platform. Manage projects, upload data, and download datasets programmatically or from the command line.

Installation

pip install --upgrade unitlab

Requires Python 3.10+.

Configuration

Get your API key from unitlab.ai and configure the CLI:

# Set API key
unitlab configure --api-key YOUR_API_KEY

# Set a custom API URL
unitlab configure --api-url https://api.unitlab.ai

# Set both at once
unitlab configure --api-key YOUR_API_KEY --api-url https://api.unitlab.ai

Or set environment variables:

export UNITLAB_API_KEY=YOUR_API_KEY

# Optional: point to a custom API server (e.g. self-hosted)
export UNITLAB_API_URL=https://api.unitlab.ai

Python SDK

from unitlab import UnitlabClient

# Initialize with an explicit key
client = UnitlabClient(api_key="YOUR_API_KEY")

# Or read from UNITLAB_API_KEY env var / config file
client = UnitlabClient()

The client can also be used as a context manager:

with UnitlabClient() as client:
    projects = client.projects()

Projects

# List all projects
projects = client.projects()

# Get project details
project = client.project("PROJECT_ID")

# Get project members
members = client.project_members("PROJECT_ID")

Upload data

client.project_upload_data(
    project_id="PROJECT_ID",
    directory="./images",
)

Additional options for specific project types:

# Text projects
client.project_upload_data("PROJECT_ID", "./docs", sentences_per_chunk=10)

# Video projects
client.project_upload_data("PROJECT_ID", "./videos", fps=30.0)

Datasets

# List all datasets
datasets = client.datasets()

# Download annotations (COCO, YOLOv8, YOLOv5, etc.)
path = client.dataset_download("DATASET_ID", export_type="COCO", split_type="train")

# Download raw files
folder = client.dataset_download_files("DATASET_ID")

CLI

Projects

# List projects
unitlab project list

# Project details
unitlab project detail PROJECT_ID

# Project members
unitlab project members PROJECT_ID

# Upload data to a project
unitlab project upload PROJECT_ID --directory ./images

Datasets

# List datasets
unitlab dataset list

# Download annotations
unitlab dataset download DATASET_ID --export-type COCO --split-type train

# Download raw files
unitlab dataset download DATASET_ID --download-type files

Documentation

See the full documentation for detailed guides:

License

MIT

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

unitlab-2.4.5.tar.gz (10.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

unitlab-2.4.5-py3-none-any.whl (10.9 kB view details)

Uploaded Python 3

File details

Details for the file unitlab-2.4.5.tar.gz.

File metadata

  • Download URL: unitlab-2.4.5.tar.gz
  • Upload date:
  • Size: 10.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for unitlab-2.4.5.tar.gz
Algorithm Hash digest
SHA256 2d47c9ee5d0056f4e1d4c09f4689e93f60a69cc1447c137d8f0257fef9552072
MD5 3032247e91eaaabd0b77cb70cc8504df
BLAKE2b-256 68a2d17e895dd0448640f01008d35318abb5aabcad1a8411391807ac9e629ffb

See more details on using hashes here.

File details

Details for the file unitlab-2.4.5-py3-none-any.whl.

File metadata

  • Download URL: unitlab-2.4.5-py3-none-any.whl
  • Upload date:
  • Size: 10.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for unitlab-2.4.5-py3-none-any.whl
Algorithm Hash digest
SHA256 2fd5446f53ad09a40f3eacc0aedace5b36ba2765aaf40c46063ce99c2d11d3c0
MD5 693ebf6f5b038208a5575166002ce53d
BLAKE2b-256 8e6124d8c14f67fcde87c420dc6ba0db5f97649478a0d9646774ee6b1bf9c18b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page