https://github.com/labelbox/labelbox-python
The data factory for next gen AI
https://github.com/labelbox/labelbox-python
ai annotation ml mlops python sdk
Last synced: 8 months ago
JSON representation
The data factory for next gen AI
- Host: GitHub
- URL: https://github.com/labelbox/labelbox-python
- Owner: Labelbox
- License: apache-2.0
- Created: 2018-09-04T22:43:50.000Z (over 7 years ago)
- Default Branch: develop
- Last Pushed: 2025-04-11T18:21:59.000Z (9 months ago)
- Last Synced: 2025-04-11T19:38:51.793Z (9 months ago)
- Topics: ai, annotation, ml, mlops, python, sdk
- Language: Python
- Homepage: https://labelbox.com
- Size: 157 MB
- Stars: 135
- Watchers: 16
- Forks: 65
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
- Security: SECURITY.md
Awesome Lists containing this project
README
[](https://github.com/Labelbox/labelbox-python/releases)
[](https://github.com/Labelbox/labelbox-python/actions/workflows/python-package-develop.yml)
[](https://pepy.tech/project/labelbox)
[](https://libraries.io/github/labelbox/labelbox-python)
[](https://github.com/labelbox/labelbox-python/issues)
[](https://docs.labelbox.com/changelog)
[](https://opensource.org/licenses/Apache-2.0)
[](https://twitter.com/labelbox)
[](https://www.linkedin.com/company/labelbox/)
[](https://img.shields.io/pypi/pyversions/labelbox)
[](https://slsa.dev)
# Labelbox
With Labelbox, enterprises can easily curate and annotate data, generate high-quality human feedback data for computer vision and language models, evaluate and improve model performance, and automate tasks by seamlessly combining AI and human-centric workflows. The academic and research community also relies on Labelbox for cutting-edge AI research and experimentation.
Visit [Labelbox](http://labelbox.com/) for more information.
## Table of Contents
- [Quick Start](#quick-start)
- [Contribution Guidelines](#contribution-guidelines)
- [Develop with AI Assistance](#develop-with-ai-assistance)
- [Documentation](#documentation)
- [Jupyter Notebooks](#jupyter-notebooks)
## Quick Start
### Sign Up
If you haven't already, create a free account at [Labelbox](http://app.labelbox.com/).
### Generate an API key
Log into Labelbox and navigate to [Account > API Keys](https://docs.labelbox.com/docs/create-an-api-key) to generate an API key.
### Install
To install the SDK, run the following command.
```bash
pip install labelbox
```
If you'd like to install the SDK with enhanced functionality, which additional optional capabilities surrounding data processing, run the following command.
```bash
pip install "labelbox[data]"
```
**Please note that if you prefer to build and install your own version of the SDK, it is important to be aware that only tagged commits have been thoroughly tested. Building from the head of develop branch carries some level of risk.**
### Validate Installation and API Key
After installing the SDK and getting an API Key, it's time to validate them both.
```python
import labelbox as lb
client = lb.Client(API_KEY) # API_KEY = API Key generated from labelbox.com
dataset = client.create_dataset(name="Test Dataset")
data_rows = [{"row_data": "My First Data Row", "global_key": "first-data-row"}]
task = dataset.create_data_rows(data_rows)
task.wait_till_done()
```
You should be set! Running the snippet above should create a dataset called `Test Dataset` with its content being `My First Data Row`. You can log into [Labelbox](http://labelbox.com/) to verify this. If you have any issues please file a Github Issue or contact [Labelbox Support](https://docs.labelbox.com/docs/contacting-customer-support) directly. For more advanced examples and information on the SDK, see [Documentation](#documentation) below.
## Contribution Guidelines
We encourage anyone to contribute to this repository to help improve it. Please refer to [Contributing Guide](CONTRIBUTING.md) for detailed information on how to contribute. This guide also includes instructions for how to build and run the SDK locally.
## Documentation
The SDK is well-documented to help developers get started quickly and use the SDK effectively. Here are links to that documentation:
- [Labelbox Official Documentation](https://docs.labelbox.com/docs/overview)
- [Jupyter Notebook Examples](https://github.com/Labelbox/labelbox-python/tree/develop/examples)
- [Python SDK Reference](https://labelbox-python.readthedocs.io/en/latest/)
## Jupyter Notebooks
We have samples in the `examples` directory to help you get started with the SDK.
Make sure your notebook will use your source code:
1. `ipython profile create`
2. `ipython locate` - will show where the config file is. This is the config file used by the Jupyter server, since it runs via ipython
3. Open the file (this should be ipython_config.py and it is usually located in ~/.ipython/profile_default) and add the following line of code:
```
c.InteractiveShellApp.exec_lines = [
'import sys; sys.path.insert(0, "")'
]
```
4. Go to the root of your project and run `jupyter notebook` to start the server.
## Provenance
To enhance the software supply chain security of Labelbox's users, as of v.3.72.2, every Labelbox SDK release contains a [SLSA Level 3 Provenance](https://github.com/slsa-framework/slsa-github-generator/blob/main/internal/builders/generic/README.md) document.
This document provides detailed information about the build process, including the repository and branch from which the package was generated.
By using the [SLSA framework's official verifier](https://github.com/slsa-framework/slsa-verifier), you can verify the provenance document to ensure that the package is from a trusted source. Verifying the provenance helps confirm that the package has not been tampered with and was built in a secure environment.
Example of usage for the v.3.72.2 release wheel:
```
export VERSION=3.72.2 # sdk release version
export TAG=v.3.72.2 # github tag
pip download --no-deps labelbox==${VERSION}
curl --location -O \
https://github.com/Labelbox/labelbox-python/releases/download/${TAG}/multiple.intoto.jsonl
slsa-verifier verify-artifact --source-branch develop --builder-id 'https://github.com/slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@refs/tags/v2.0.0' --source-uri "git+https://github.com/Labelbox/labelbox-python" --provenance-path multiple.intoto.jsonl ./labelbox-${VERSION}-py3-none-any.whl
```