{"id":20173014,"url":"https://github.com/humansignal/label-studio-sdk","last_synced_at":"2025-05-15T05:07:00.385Z","repository":{"id":39699811,"uuid":"423601686","full_name":"HumanSignal/label-studio-sdk","owner":"HumanSignal","description":"Label Studio SDK","archived":false,"fork":false,"pushed_at":"2025-05-14T17:13:32.000Z","size":48258,"stargazers_count":136,"open_issues_count":66,"forks_count":89,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-05-14T18:27:38.286Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://api.labelstud.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/HumanSignal.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-11-01T20:08:18.000Z","updated_at":"2025-05-14T17:13:37.000Z","dependencies_parsed_at":"2023-07-24T05:34:28.469Z","dependency_job_id":"ca25e3d4-5952-4c63-823b-a9aa39a20230","html_url":"https://github.com/HumanSignal/label-studio-sdk","commit_stats":{"total_commits":588,"total_committers":59,"mean_commits":9.966101694915254,"dds":0.7329931972789115,"last_synced_commit":"114c2b30bd36b2ff4577abc40f05955630a59f6b"},"previous_names":["humansignal/label-studio-sdk","heartexlabs/label-studio-sdk"],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HumanSignal%2Flabel-studio-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HumanSignal%2Flabel-studio-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HumanSignal%2Flabel-studio-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HumanSignal%2Flabel-studio-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HumanSignal","download_url":"https://codeload.github.com/HumanSignal/label-studio-sdk/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254276447,"owners_count":22043867,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-14T01:33:11.313Z","updated_at":"2025-05-15T05:06:55.371Z","avatar_url":"https://github.com/HumanSignal.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Label Studio Python Library\n\n\u003c!-- Note about deprecated version \u003c1 --\u003e\n---\n\u003e :warning: **Note**\u003cbr/\u003e\n\u003e\n\u003e The version of `label-studio-sdk\u003c1` is deprecated and no longer supported. We recommend updating to the latest version.\n\u003e If you still want to use the old version, you can install it with `pip install \"label-studio-sdk\u003c1\"`.\n\u003e OR You can find the branch with the old version by cloning the repository and checking out the branch as follows:\n\u003e\n\u003e ```sh\n\u003e git clone https://github.com/HumanSignal/label-studio-sdk.git\n\u003e cd label-studio-sdk\n\u003e git fetch origin\n\u003e git checkout release/0.0.34\n\u003e ```\n\u003e \n\u003e OR you can change your import statements as follows:\n\u003e ```python\n\u003e from label_studio_sdk import Client\n\u003e from label_studio_sdk.data_manager import Filters, Column, Operator, Type\n\u003e from label_studio_sdk._legacy import Project\n\u003e ```\n---\n\n[![fern shield](https://img.shields.io/badge/%F0%9F%8C%BF-SDK%20generated%20by%20Fern-brightgreen)](https://github.com/fern-api/fern)\n[![pypi](https://img.shields.io/pypi/v/label-studio-sdk.svg)](https://pypi.python.org/pypi/label-studio-sdk)\n\nThe Label Studio Python Library provides convenient access to the Label Studio API from applications written in Python.\n\u003c!-- End Title  --\u003e\n\n\u003c!-- Outline --\u003e\n\n\n# Documentation\nExplore the Label Studio API documentation [here](https://api.labelstud.io/).\n\n\n# Installation\n\n```sh\npip install --upgrade label-studio-sdk\n# or\npoetry add label-studio-sdk\n```\n\n# Usage\n\n```python\nfrom label_studio_sdk.client import LabelStudio\n\nls = LabelStudio(\n    base_url='YOUR_LABEL_STUDIO_URL',  \n    api_key=\"YOUR_API_KEY\",\n)\n```\n\n# Examples\n\nCheck more examples [here](https://api.labelstud.io/).\n\n## Create a new project\n\n```python\nfrom label_studio_sdk.label_interface import LabelInterface\nfrom label_studio_sdk.label_interface.create import labels\n\nproject = ls.projects.create(\n    name=\"Project name\",\n    description=\"Project description\",\n    label_config=LabelInterface.create({\n      \"image\": \"Image\",\n      \"bbox\": labels([\"cat\", \"dog\"], tag_type=\"RectangleLabels\")\n    })\n)\n```\n\n## Create a new task\n    \n```python\ntask = ls.tasks.create(\n    project=project.id,\n    data={\"image\": \"https://example.com/image.jpg\"}\n)\n```\nNow you can open the project `PROJECT_ID` in the Label Studio UI and create annotations for the task.\n\n## Export annotations\n\n```python\nannotations = [\n    task.annotations\n    for task in ls.tasks.list(project=project.id, fields='all')\n    if task.annotations\n]\n```\n\n\n## Async client\n\n```python\nfrom label_studio_sdk.client import AsyncLabelStudio\n\nclient = AsyncLabelStudio(\n    api_key=\"YOUR_API_KEY\",\n)\n```\n\n## Advanced\n\n### Timeouts\nBy default, requests time out after 60 seconds. You can configure this with a \ntimeout option at the client or request level.\n\n```python\nfrom label_studio_sdk.client import LabelStudio\n\nls = LabelStudio(\n    # All timeouts set to 20 seconds\n    timeout=20.0\n)\n\nls.projects.create(..., {\n    # Override timeout for a specific method\n    timeout=20.0\n})\n```\n\n### Custom HTTP client\nYou can override the httpx client to customize it for your use-case. Some common use-cases \ninclude support for proxies and transports.\n\n```python\nimport httpx\n\nfrom label_studio_sdk.client import LabelStudio\n\nls = LabelStudio(\n    http_client=httpx.Client(\n        proxies=\"http://my.test.proxy.example.com\",\n        transport=httpx.HTTPTransport(local_address=\"0.0.0.0\"),\n    ),\n)\n```\n\n## Enterprise features\n\n### Create comments\n    \n```python\ncomment = ls.comments.create(\n    project=project.id,\n    annotation=annotation.id,\n    text=\"Comment text\"\n)\n```\n\n\u003c!-- Begin Contributing, generated by Fern  --\u003e\n# Contributing\n\nPlease follow [this guide to contribute to the SDK](https://github.com/HumanSignal/label-studio-client-generator?tab=readme-ov-file#how-to-contribute)\n\nWhile we value open-source contributions to this SDK, this library is generated programmatically. \nAdditions made directly to this library would have to be moved over to our generation code, \notherwise they would be overwritten upon the next generated release. Feel free to open a PR as\n a proof of concept, but know that we will not be able to merge it as-is. We suggest opening \nan issue first to discuss with us!\n\nOn the other hand, contributions to the README are always very welcome!\n\u003c!-- End Contributing  --\u003e\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhumansignal%2Flabel-studio-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhumansignal%2Flabel-studio-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhumansignal%2Flabel-studio-sdk/lists"}