Introduction
What are Data Connectors?
A data connector in Labellerr is a saved set of cloud storage credentials (for AWS S3 or Google Cloud Storage) that authorises Labellerr to securely access your bucket, without storing or moving credentials manually on every operation.Connectors are reusable, once a connector credential is saved, it can be used across multiple datasets and projects. The SDK provides full lifecycle management:
- Create connector credentials for AWS S3 or GCP GCS
- Test connector credentials before saving them
- List all existing connector credentials by provider and type
- Delete connector credentials that are no longer needed
Connector Types
| Type | Enum Value | Description |
|---|---|---|
| Import | ConnectionType._IMPORT | Pull files from cloud storage into Labellerr |
| Export | ConnectionType._EXPORT | Push annotation results back to cloud storage |
Provider Types
| Provider | Enum Value | Description |
|---|---|---|
| AWS S3 | ConnectorType._S3 | Amazon Simple Storage Service |
| GCP GCS | ConnectorType._GCS | Google Cloud Storage |
Required Imports
Required Imports
Connect to AWS S3
Connect AWS S3 Bucket
Use
LabellerrS3Connection to create a connection to your Amazon S3 bucket. It is strongly recommended to test the connection first before saving it to ensure your IAM credentials and path are valid.Test the Connection (Recommended)
Call
LabellerrS3Connection.test_connection() with a specific S3 path to validate credentials and permissions.Connect to AWS S3
S3 Path Format: Always use the
s3://bucket-name/folder/subfolder/ format. Include a trailing slash for folder paths.Connect to GCP (Google Cloud Storage)
Connect GCP GCS Bucket
Use
LabellerrGCSConnection to create a connection to your Google Cloud Storage bucket. You will need a service account JSON key file with the appropriate permissions.Test the Connection (Recommended)
Call
LabellerrGCSConnection.test_connection() to validate your service account credentials and path access.Connect to GCP GCS
GCS Path Format: Always use the
gs://bucket-name/folder/subfolder/ format. Include a trailing slash for folder paths. Your service account JSON key file must be readable from the machine running the SDK.List Connections
List All Connections
Use
list_connections() to retrieve all saved connections for a given cloud provider and connection type. This is useful to inspect existing connections, find a connection ID to reuse, or audit what connections are configured.List Connections
Delete a Connection
Delete Connection
Use
delete_connection() to permanently remove a saved connection by its connection ID. This is useful for cleaning up unused or outdated connections.Delete Connection
Error Handling
Best Practices for Error Handling
Always wrap connection operations in
try-except blocks using LabellerrError to handle failures gracefully.Error Handling Example
API Reference
LabellerrS3Connection.create_connection(client, params)
LabellerrS3Connection.create_connection(client, params)
LabellerrS3Connection object with properties:connection_id: str— Unique identifier for the connectionname: str— Display name of the connectiondescription: str— Optional descriptionconnector_type: str— Always"s3"for S3 connectionsconnection_type: str—"import"or"export"created_at: datetime— Timestamp of creation
LabellerrGCSConnection.create_connection(client, params)
LabellerrGCSConnection.create_connection(client, params)
LabellerrGCSConnection object with properties:connection_id: str— Unique identifier for the connectionname: str— Display name of the connectiondescription: str— Optional descriptionconnector_type: str— Always"gcs"for GCS connectionsconnection_type: str—"import"or"export"created_at: datetime— Timestamp of creation
list_connections(client, connector, connection_type)
list_connections(client, connector, connection_type)
| Parameter | Type | Description |
|---|---|---|
client | LabellerrClient | Authenticated client instance |
connector | ConnectorType | ConnectorType._S3 or ConnectorType._GCS |
connection_type | ConnectionType | ConnectionType._IMPORT or ConnectionType._EXPORT |
connection_id, name, description, connector_type, connection_type, created_at.delete_connection(client, connection_id)
delete_connection(client, connection_id)
| Parameter | Type | Description |
|---|---|---|
client | LabellerrClient | Authenticated client instance |
connection_id | str | ID of the connection to delete |
Common Use Cases
Reuse Across Datasets
Create one S3 or GCS connection and use the same
connection_id across multiple datasets, avoiding repeated credential entry.Import Large Datasets
Connect directly to cloud storage buckets containing thousands of files, bypassing local upload limits (2,500 files / 2.5 GB).
Export Annotations
Create an export-type connection to automatically push completed annotation exports back to your S3 or GCS bucket.
Audit & Cleanup
Use
list_connections() periodically to audit all active connections and delete_connection() to remove unused ones.Related Documentation
Create Datasets
Use your connections to create datasets directly from cloud storage
Connect AWS S3
Step-by-step guide to configure AWS IAM permissions for S3
Connect GCS
Step-by-step guide to configure a GCS service account
For technical support, contact support@tensormatics.com

