Actively maintained. Last release 10 days ago, commits in 26 of the last 26 weeks. A safe choice.
pip install label-studio-sdkLabel Studio Python Library
The Label Studio Python Library provides convenient access to the Label Studio API from applications written in Python.
Documentation
Explore the Label Studio API documentation here.
Installation
pip install --upgrade label-studio-sdk
# or
poetry add label-studio-sdk
Usage
from label_studio_sdk import LabelStudio
client = LabelStudio(
base_url='YOUR_LABEL_STUDIO_URL',
api_key="YOUR_API_KEY",
)
CLI
The SDK also includes a CLI entrypoint that mirrors SDK resources and methods.
On leaf commands (for example projects create), use -h for minimal help (one-line summary, SDK signature, and options) and --help for the full generated documentation (parameters, examples, return shape, and options). Top-level groups only register --help.
Nested Fern client groups map to nested CLI subcommands: dots in the Python SDK path become spaces, and underscores become hyphens. For example, client.projects.stats.label_distribution_counts(...) is:
label-studio-sdk projects stats label-distribution-counts --param id=1 --dry-run
Other nested examples: import-storage s3 list, organizations members list, analytics kpis ..., sso saml ....
export LABEL_STUDIO_API_KEY="YOUR_API_KEY"
export LABEL_STUDIO_URL="YOUR_BASE_URL"
# minimal help for one command
label-studio-sdk projects create -h
# full help (longer)
label-studio-sdk projects create --help
# nested group help
label-studio-sdk projects stats --help
# top-level
label-studio-sdk --help
# List projects
label-studio-sdk projects list
# Create a project (generic key=value params)
label-studio-sdk projects create \
--param title="CLI Example" \
--param 'label_config=<View><Text name="text" value="$text"/></View>'