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 page 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_upload Create a dataset with your own annotations.
dataset_download Download the dataset's annotation.
dataset_update Add more data to an existing dataset.
dataset_download_files Download raw dataset files
Examples
Here are some examples of how to use the Python SDK functions
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.
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.
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.