πŸ›‘οΈUnitlab Python SDK

With Unitlab in your Python code

circle-info

These code snippets demonstrate how to use the most common Python SDK functions.

To get started, import the unitlab package and initialize a client with an API key. To obtain an API key, navigate to your user account pagearrow-up-right and follow the instructions to create a new key.

from unitlab import UnitlabClient

# You can find your API key at https://app.unitlab.ai/Unitlab/api-keys
api_key = "YOUR_API_KEY_HERE"
client = UnitlabClient(api_key)

Available methods

The following are some of the most common Python SDK methods:

projects                    Get a list of projects.
project                     Get project information.
project_members             Get project's members.
project_upload_data         Upload data samples to a project.
datasets                    Get a list of available datasets.
dataset_download            Download the dataset's annotation.
dataset_download_files      Download raw dataset files

Examples

Here are some examples of how to use the Python SDK functions

Get project list

This command will return a list of all your projects, including the project ID, ai_model, name, number_of_data, annotator progress, reviewer progress, creator, and created date.

Get project members

It will return a list of the project's members, including their IDs, emails, positions, and statistics.

Add data samples to a project.

To upload data samples to an existing project, provide the project ID and the directory containing the data samples and run the provided code.

Download a dataset

You can easily download the results of labelled data using the Python SDK. Retrieve your dataset ID and execute the dataset_download method. It will download the annotated results.

Additional methods

The Python SDK provided by Unitlab offers a wealth of additional functions beyond those highlighted here. Users can utilize these methods according to their unique needs and preferences.

Last updated