Retrieving All Projects for a Client
You can retrieve all projects associated with a specific client ID using the SDK’s project listing functionality:Important: The
list_projects() method only retrieves projects created after April 15th, 2025.Example Usage:
Retrieve All Projects
- List all projects for a client
- Find specific project IDs
- Check project statuses and configurations
- Get an overview of client’s work
- Access project properties programmatically
LabellerrProject objects, each with access to properties like project_id, data_type, attached_datasets, created_by, and more.
Retrieving All Datasets
You can retrieve both linked and unlinked datasets associated with a client using the SDK’s dataset listing capabilities:Example Usage:
Retrieve All Datasets
Pagination Support:
- Returns a generator that yields individual datasets
- Use
page_size=-1to automatically paginate through all datasets (recommended) - Use specific
page_sizeto limit results (e.g.,page_size=20) - Use
last_dataset_idfor manual pagination across multiple requests - Generator approach is memory-efficient for large numbers of datasets
- Get a comprehensive list of all datasets in your workspace
- Filter datasets by specific data types (image, video, audio, document, text)
- Organize datasets by scope (client-level or project-level permissions)
- Efficiently iterate through large numbers of datasets with pagination
- Memory-efficient processing of datasets using generators
Advanced Pagination Examples
- Auto-Pagination (Recommended)
- Fixed Page Size
- Manual Pagination
Auto-Paginate Through All Datasets
Retrieving Files from a Dataset
You can fetch all files from a specific dataset using thefetch_files() method:
Example Usage:
Fetch Files from Dataset
- Get a list of all files in a dataset
- Check file statuses before creating a project
- Verify dataset contents
- Build custom file processing workflows
Working with Projects and Datasets
Get Project Information
Get Project Details
Attach Datasets to a Project
Attach Datasets
Detach Datasets from a Project
Detach Datasets
Important: When detaching datasets from a project, the method no longer requires
client_id and project_id parameters as these are automatically derived from the project instance.Bulk Assign Files
You can bulk assign multiple files to a new status in a project, optionally assigning them to a specific user.Example Usage:
Bulk Assign Files
Acceptable Status Values
When to Use Bulk Assign
Bulk assign is essential for automating annotation workflows:Common Use Cases
bulk_assign_files(), it’s one API call:
Error Handling
The Labellerr SDK uses a custom exception class,LabellerrError, to indicate issues during API interactions. Always wrap your function calls in try-except blocks to gracefully handle errors.
Example:
Error Handling Example
API Reference
Function Signatures
list_projects(client)
list_projects(client)
list_datasets(client, datatype, scope, page_size, last_dataset_id)
list_datasets(client, datatype, scope, page_size, last_dataset_id)
LabellerrDataset.fetch_files()
LabellerrDataset.fetch_files()
- file_id: str
- file_name: str
- status: str
- file_type: str
- file_size: int
LabellerrProject - Properties
LabellerrProject - Properties
attach_dataset_to_project(dataset_id=None, dataset_ids=None)detach_dataset_from_project(dataset_id=None, dataset_ids=None)bulk_assign_files(file_ids, new_status, assign_to=None)upload_preannotations(annotation_format, annotation_file, conf_bucket=None, _async=False)create_export(export_config)list_exports()- Get all exports (completed and in-progress) for the projectcheck_export_status(report_ids)- Check status of specific exports
Best Practices
Use Auto-Pagination
Set
page_size=-1 for list_datasets() to automatically handle all pages without manual interventionLeverage Generators
Process datasets as they’re retrieved instead of loading all into memory at once
Filter by Scope
Use
DataSetScope.client for workspace-level datasets or DataSetScope.project for project-specific onesError Handling
Always wrap API calls in try-except blocks to catch
LabellerrError exceptionsThe Labellerr SDK is a fast and reliable solution for managing annotation workflows. Want to try it end-to-end? Refer to this Google Colab Cookbook for a ready-to-run tutorial. For more related cookbooks and examples, please visit our repository: Labellerr Hands-On Learning

