Skip to main content
The Python SDK is a client for the dataerai transfer daemon. Its methods are blocking, so they’re easy to use in a script or a Jupyter notebook. The daemon starts automatically if it isn’t already running.

Requirements

  • Python 3.10+
  • The dataerai binary on your PATH (see the CLI overview), or pass binary_path explicitly.
  • Signed in with dataerai auth login (see Authenticate).

Install

The SDK drives the local dataerai binary. The quickest way to get it is to install the CLI, which bundles the binary for your platform:
Working with scientific instrument files (AFM, electron microscopy, RHEED, X-ray)? The same package ships an optional metadata extractor — install it with pip install "dataerai-sdk[metaextract]" and see Metadata extraction.

Quickstart

Use the client as a context manager (with ... as client:) for automatic cleanup, or call client.connect() and client.close() yourself.

Methods

upload() arguments

title, owner_type ("project" or "user"), and owner_id are required. Optional: description, alias, tags, metadata (dict), collection_id, chunk_size_mb, on_progress (callback), and transfer_timeout_s (default 3600). The on_progress callback receives a ProgressEvent with bytes_done, bytes_total, file_name, and convenience percent and rate_mbps properties.

Provenance relationships

Link two assets to record how your data came to be — for example that an analysis was derived from a measurement, or that raw data was acquired with a configuration. See Provenance & relationships for the model.
create_relationship(from_asset_id, to_asset_id, rel_type, *, ...) creates a directed edge from the derived asset to its origin; rel_type is a free-form verb describing the source’s role (for example "analysis_of" or "acquired_with"). You need write access to the source and read access to the target. Optional keyword arguments: analysis_mode (one of non_destructive, altering, destructive, in_situ, ex_situ, invasive, non_invasive), qualifier_note, qualifier_time, and qualifiers (dict). It returns a Relationship and raises DaemonError with ERR_RELATIONSHIP_EXISTS if an identical link already exists. For notebook integrations that prefer named relationship fields, pass the relationship verb with the keyword-only alias relationship_type, for example relationship_type="derived_from".
Building an instrument-control workflow? The QICK integration uses create_relationship to capture experiment provenance automatically.

Errors

Next steps

CLI

The command-line client the SDK builds on.

Node SDK

The same operations from Node.js.

QICK integration

Capture quantum-experiment provenance automatically.

Provenance

How relationships model your data’s lineage.