Labelbox Python API
Actively maintained. Last release 6 weeks ago, commits in 15 of the last 26 weeks. A safe choice.
pip install labelboxLabelbox
Core mono-module for Labelbox's Python SDK.
Table of Contents
Setup
rye sync --all-features # to install labelbox[data] dependencies
Repository Organization
The SDK source (excluding tests and support tools) is organized into the following packages/modules:
data/package contains code that maps annotations (labels or pre-labels) to Python objects, as well as serialization and deserialization tools for converting between NDJson and Annotation Types.orm/package contains code that supports the general mapping of Labelbox data to Python objects. This includes base classes, attribute (field and relationship) classes, generic GraphQL queries etc.schema/package contains definitions of classes which represent data type (e.g. Project, Label etc.). It relies onorm/classes for easy and succinct object definitions. It also contains custom functionalities and custom GraphQL templates where necessary.client.pycontains theClientclass that's the client-side stub for communicating with Labelbox servers.exceptions.pycontains declarations for all Labelbox errors.pagination.pycontains support for paginated relationship and collection fetching.utils.pycontains utility functions.
Testing
Unit Testing
rye run unit
Integration Testing
LABELBOX_TEST_API_KEY="YOUR_API_TEST_KEY" LABELBOX_TEST_ENVIRON="prod" rye run integration
For more info on how to get a LABELBOX_TEST_API_KEY Labelbox API key docs.
Integration tests by default will run against your account that you provide an API Key from and modify its data. If you want to run integration tests, without it impacting your existing account, create an additional account using a secondary e-mail on Labelbox. Free accounts are sufficent for integration testing purposes.