The SDK provides functionality to export project data locally. This feature allows you to export annotations in various formats for further analysis or backup purposes.The export created will be available in the exports section of Labellerr dashboard. Here is where you can find theexport in our tool.
from labellerr.client import LabellerrClientfrom labellerr.core.projects import LabellerrProjectfrom labellerr.core.schemas import CreateExportParamsfrom labellerr.core.exceptions import LabellerrError# Initialize the client with your API credentialsclient = LabellerrClient( api_key='your_api_key', api_secret='your_api_secret', client_id='your_client_id')project_id = 'your_project_id'try: # Get project instance project = LabellerrProject(client=client, project_id=project_id) # Create export configuration using CreateExportParams export_config = CreateExportParams( export_name="Weekly Export", export_description="Export of all accepted annotations", export_format="coco_json", statuses=['review', 'r_assigned','client_review', 'cr_assigned','accepted'] ) # Create export export = project.create_export(export_config) print(f"Local export created successfully. Export ID: {export.report_id}") # Optionally wait for completion export.status() # Polls until export is completeexcept LabellerrError as e: print(f"Local export creation failed: {str(e)}")
Note: The export process creates a downloadable file link of your project’s annotations based on the specified status filters. This is useful for backup purposes or when you need to process the annotations offline.
The SDK also provides functionality to export project data directly to AWS S3 buckets. This feature allows you to export annotations in various formats directly to your S3 storage for automated workflows, backup, or integration with other systems.The export created will be available in the exports section of Labellerr dashboard. Here is where you can find theexport in our tool.
The SDK provides functionality to retrieve all exports associated with a project. This method returns both completed and in-progress exports, making it easy to track and manage your export history.
New Feature: Filter files based on their last updated time to create incremental exports!
You can now filter files based on their last updated timestamp when creating exports. This powerful feature enables incremental backups where only files modified after a specific time are exported, significantly reducing export size and processing time.
This method allows users to check the export status of a previously triggered export task (both local and S3 exports). The status will indicate whether the export is still processing, completed, or failed. For local exports, if successful, the function also sends the downloadable file link URL with its expiration time and status. For S3 exports, it indicates when the export has been successfully uploaded to your S3 bucket.
This endpoint is used to fetch the downloadable link for a previously created local export using the export’s UUID and report ID. The response includes a signed URL from which the export file can be downloaded with the time left to expire.Note: This method is only applicable for local exports. For S3 exports, the files are directly uploaded to your S3 bucket at the specified path.
from labellerr.client import LabellerrClientfrom labellerr.core.exceptions import LabellerrErrorimport uuid# Initialize the client with your API credentialsclient = LabellerrClient( api_key='your_api_key', api_secret='your_api_secret', client_id='your_client_id')project_id = 'your_project_id'report_ids = ['export_report_id'] # make sure it is a listrequest_uuid = str(uuid.uuid4())try: download_url = client.fetch_download_url( project_id=project_id, uuid=request_uuid, export_id=report_ids[0] ) print(f"Download URL: {download_url}")except LabellerrError as e: print(f"Failed to fetch download URL: {str(e)}")