Asset Sources
Access asset sources through client.asset_sources in the Datature Vi SDK.
An asset source describes where the assets in a dataset originated: a direct upload, a connected S3 bucket, a cloud drive, and so on. The local upload source is created implicitly when you call client.assets.upload(), but the endpoints here let you inspect any configured source, sample a few of its assets, track its ingestion sessions, and remove sources no longer in use.
- Vi SDK installed with authentication configured
- An existing dataset with assets, or a connected external bucket
Sources are addressed by a (class, provider, id) triple. Assets uploaded through the built-in flow use LocalProvider / DirectUpload / <source_id>.
Methods
list()
List asset sources configured on a dataset.
for src in client.asset_sources.list("dataset_abc123").all_items():
print(src["assetSourceId"], src.get("kind"))Returns: PaginatedResponse[dict]. A page of asset-source documents.
get()
Fetch a single asset source by its (class, provider, id) triple.
source = client.asset_sources.get(
dataset_id="dataset_abc123",
asset_source_class="LocalProvider",
asset_source_provider="DirectUpload",
asset_source_id="src_xyz",
)
print(source)Returns: dict. The asset-source document.
sample()
Fetch a sample of assets from an asset source. Useful for confirming a connected bucket resolves to the files you expect before ingesting everything.
sample = client.asset_sources.sample(
dataset_id="dataset_abc123",
asset_source_class="LocalProvider",
asset_source_provider="DirectUpload",
asset_source_id="src_xyz",
)
print(sample)Returns: dict. Sample payload. The exact shape depends on the source connector, but typically includes a list of preview assets.
list_ingestion_sessions()
List ingestion sessions belonging to an asset source.
These mirror the sessions created internally when uploading via client.assets.upload(), exposed so you can inspect the history or build your own dashboards.
sessions = client.asset_sources.list_ingestion_sessions(
dataset_id="dataset_abc123",
asset_source_class="LocalProvider",
asset_source_provider="DirectUpload",
asset_source_id="src_xyz",
)
for session in sessions.all_items():
print(session)Returns: PaginatedResponse[dict]. A page of ingestion-session documents.
get_ingestion_session()
Fetch a specific ingestion session by ID.
session = client.asset_sources.get_ingestion_session(
dataset_id="dataset_abc123",
asset_source_class="LocalProvider",
asset_source_provider="DirectUpload",
asset_source_id="src_xyz",
asset_ingestion_session_id="ais_123",
)
print(session)Returns: dict. The ingestion-session document.
cancel_ingestion_session()
Cancel an in-flight ingestion session.
client.asset_sources.cancel_ingestion_session(
dataset_id="dataset_abc123",
asset_source_class="LocalProvider",
asset_source_provider="DirectUpload",
asset_source_id="src_xyz",
asset_ingestion_session_id="ais_123",
)Returns: dict. The cancellation response document.
delete()
Delete an asset source.
This removes the source configuration only. Assets already ingested from the source remain in the dataset.
client.asset_sources.delete(
dataset_id="dataset_abc123",
asset_source_class="LocalProvider",
asset_source_provider="DirectUpload",
asset_source_id="src_xyz",
)Returns: DeletedResource. Confirmation of deletion.
Response format
Asset sources are returned as plain dictionaries mirroring the platform's documents.
Related resources
Updated 1 day ago
