Skip to main content

Avala Python SDK

PyPI version Python CI License: MIT

Official Python SDK for the Avala API — the open Physical AI Data Platform. Programmatically manage sensor datasets (MCAP, LiDAR, video), annotation projects, exports, tasks, and fleet devices.

Note: This repository is a read-only mirror. To report bugs or request features, please open an issue. See CONTRIBUTING.md for details.

Installation

pip install avala

Requires Python 3.9+.

Quick Start

from avala import Client  # or: from avala import Avala

client = Client()  # reads AVALA_API_KEY env var

# List datasets
page = client.datasets.list(limit=10)
for dataset in page:
    print(dataset.uid, dataset.name)

# Get a specific dataset
dataset = client.datasets.get("dataset-uid")

# Create an export and wait for completion
export = client.exports.create(project="project-uid")
finished = client.exports.wait(export.uid)  # polls until done
print(finished.download_url)

# List tasks with filters
tasks = client.tasks.list(project="project-uid", status="completed")

Submit vendor recordings

Hosted vendor contributions and vendor key issuance are paused during the reader-first rollout. For an enabled local or CI environment:

  1. Set AVALA_API_KEY to a vendor key provisioned for that environment, and AVALA_BASE_URL to its API base URL.
  2. With avala[cli] installed, run avala import contribute --source ./delivery-videos --name "Kitchen". Names are case-sensitive. The name is required on every delivery. Use another name for a separate dataset. Open the printed Mission Control Review path to play your recordings and see their status. The uploader stages one recording at a time so retries send the same bytes. Allow temporary disk space for your largest recording.
  3. Add files and rerun the same command. The first run creates your private intake. Avala checks the full-file SHA-256 digest and byte count within that dataset. Selecting a different source folder or renaming an unchanged file skips the upload. The CLI reports pending verification until the digest is confirmed, then reports Already received on replay. You can send the same recording to another named dataset. Give edited recordings a new filename.

Load Public Dataset Revisions

Published Physical AI datasets with open-download rights can be loaded without an Avala account or API key. References resolve to immutable dataset and manifest digests; object bytes are fetched lazily and verified against their declared size and SHA-256.

import avala

with avala.load("owner/dataset") as dataset:  # defaults to the "main" revision alias
    episode = dataset.episodes[0]
    with episode.open() as raw_mcap:  # verified seekable spool; large objects stay off-heap
        magic = raw_mcap.read(8)
    print(dataset.canonical_reference, episode.sha256, episode.size_bytes, magic)

Pin a reproducible revision with owner/dataset@<revision-digest> or its returned avala://datasets/<uid>@<revision-digest> canonical reference. Async code uses async with await avala.async_load(...) as dataset:, episode = await dataset.episodes[0], and content = await episode.open() (close the returned file after consuming it). Use read() only for deliberately bounded, small objects.

Resolve a revision from the CLI

With the cli extra installed, resolve a public, published dataset with open-download rights without an API key:

avala datasets resolve owner/dataset
avala --output json datasets resolve owner/dataset > dataset-reference.json
avala datasets resolve owner/dataset --revision release-1

The command fetches revision metadata only. It does not list objects, request download grants, or download dataset contents. JSON includes the canonical and requested references, dataset and revision UIDs, revision and manifest SHA-256 digests, integer object_count and total_size_bytes, and the declared rights object. Keep the returned canonical reference for reproducible inputs:

import json
from pathlib import Path

import avala

handoff = json.loads(Path("dataset-reference.json").read_text())
with avala.load(handoff["canonical_reference"]) as dataset:
    assert dataset.manifest_sha256 == handoff["manifest_sha256"]
    print(dataset.canonical_reference, dataset.object_count)

An embedded @alias or @digest also works; do not combine it with --revision. Global --base-url or AVALA_BASE_URL selects another API root. Pass that same base_url to avala.load when consuming a handoff from another environment. Metadata resolution does not verify object contents or guarantee continued availability of a withdrawn revision.

Authentication

The client reads your API key from the AVALA_API_KEY environment variable by default:

export AVALA_API_KEY="avk_your_api_key"

Or pass it explicitly:

client = Client(api_key="avk_your_api_key")

Async Support

from avala import AsyncClient

async with AsyncClient() as client:
    page = await client.datasets.list()
    for dataset in page:
        print(dataset.name)

Pagination

All .list() methods return a CursorPage that supports iteration:

page = client.datasets.list(limit=20)

for dataset in page:
    print(dataset.name)

# Manual pagination
if page.has_more:
    next_page = client.datasets.list(cursor=page.next_cursor)

Error Handling

from avala.errors import AvalaError, NotFoundError, RateLimitError, AuthenticationError

try:
    dataset = client.datasets.get("nonexistent")
except NotFoundError:
    print("Dataset not found")
except RateLimitError:
    print("Rate limited")
except AuthenticationError:
    print("Invalid API key")
except AvalaError as e:
    print(f"API error: {e}")

CLI Tool

Install the CLI with one command:

curl -fsSL https://avala.ai/install.sh | bash

Or install directly with pip:

pip install avala[cli]
avala configure                       # Interactive API key setup + validation
avala status                          # Organization dashboard overview
avala datasets list                   # List datasets
avala projects list                   # List projects
avala exports create --project <uid>  # Create an export
avala exports wait <uid>              # Poll until export completes
avala fleet devices list              # List fleet devices
avala -o json datasets list | jq .    # JSON output for scripting
avala shell-completion zsh >> ~/.zshrc # Enable tab completion
avala --version                       # Show CLI version

Fleet recording uploads

Upload files to an existing recording with the CLI or SDK. Configure your API key with avala configure for the CLI or AVALA_API_KEY for the SDK.

avala fleet recordings upload --recording RECORDING_UID --source ./recording --dry-run
avala fleet recordings upload --recording RECORDING_UID --source ./recording --wait
from avala import Client

with Client() as client:
    session = client.fleet.uploads.upload_recording("recording-uid", "./recording")
    print(session.status)

Explicit managed MCAP uploads

For an enrolled organization, add --managed to upload MCAP originals to Avala Cloud. Supply the UUID of an existing recording. This option cannot be combined with --storage-config; the default upload command and customer bucket selection keep their existing behavior.

avala fleet recordings upload --managed --recording RECORDING_UID --source ./recording --dry-run
avala fleet recordings upload --managed --recording RECORDING_UID --source ./recording --wait

The managed profile accepts 1 to 64 uncompressed .mcap files, each larger than zero and at most 8 GiB, with at most 64 GiB in one manifest. Parts use a fixed 64 MiB size, except the final part. --workers accepts 1 to 4 parallel transfers. The dry-run hashes and validates local files without credentials, API requests or receipt writes. It does not check server enrollment or remaining storage quota.

Without --wait, the command can return successfully with publication submitted and still pending. With --wait, it waits for the exact dataset publication, up to --wait-timeout seconds (0 to 3600, default 3600). A timeout or failed publication exits nonzero and retains the upload. Published output includes the dataset and publication UUIDs; it does not claim the Fleet recording is ready. --output json exposes a bounded status summary for scripts.

Keep the original files and receipt under ~/.avala/uploads/. Repeat the same command with --managed, recording, source, API and credentials to resume. Do not delete the receipt or switch an existing managed recording to the default upload command. An unsupported server or unavailable enrollment fails without falling back to a different protocol.

Upgrading to 0.10.0

This release adds public dataset revision loading through avala.load and avala.async_load, plus the anonymous avala datasets resolve metadata command. Fleet uploads now require retained evidence instead of automatically replacing uncertain sessions. This changes recovery behavior for existing uploads.

Keep the original files at the same source path and preserve the local upload receipt under ~/.avala/uploads/. Resume requires matching source contents, API, credentials, storage selection, and recording identity. Old, corrupt, or ambiguous receipts refuse automatic replacement. Finish existing work with its original inputs when possible; otherwise retain its files and receipt and use a new recording UID. Do not delete checkpoints to force a restart over the same recording. The source collector rejects symlinks and special files and excludes SDK checkpoint files, so a source tree accepted by an older version may now need correction. Resumes with 1,000 or more pending files are refused because the current server response cannot prove the complete pending inventory; fresh uploads can exceed 1,000 files.

The default SDK can return completing while server processing continues. Its CLI --wait requires both that same upload session to complete and the recording to become ready, within the wait timeout. Completed receipts are retained. Local SHA-256 checks detect observed source changes; they do not independently verify current remote contents.

Import Inspect Robots evaluation logs

Turn each trial of an Inspect Robots evaluation run into an outcome-labelled sequence. Successes map to expert_success or partial_success by a configurable score threshold, failures to failure, and errored or cancelled trials to aborted. Labels are written with source=imported and evaluation_membership=held_out_eval, and model_version comes from the run's policy. Each label stores the run id, task, trial, epoch, scene and log file name in its source_metadata. Requires pip install 'avala[inspect]' (Python 3.10+).

# Preview the mapping offline, then label the dataset's sequences (one per trial)
avala import inspect-robots logs/cubepick-reach_1a2b3c4d.json --dataset acme/cubepick-eval --dry-run
avala import inspect-robots logs/cubepick-reach_1a2b3c4d.json --dataset acme/cubepick-eval

# Or create the dataset from the trials' recorded actions and frames
avala import inspect-robots logs/cubepick-reach_1a2b3c4d.json --dataset acme/cubepick-eval --create

See the CLI reference for the full mapping table and options.

Available Resources

Resource Methods Description
client.datasets list(), get(uid) Browse and inspect datasets
client.projects list(), get(uid) Browse and inspect projects
client.exports list(), get(uid), create(), wait(uid) Create, poll, and manage annotation exports
client.tasks list(), get(uid) Browse tasks with project/status filters
client.storage_configs list(), create(), test(), delete() Manage cloud storage connections
client.agents list(), get(), create(), update(), delete(), list_executions(), test() Manage automation agents
client.inference_providers list(), get(), create(), update(), delete(), test() Manage inference providers
client.auto_label_jobs list(), get(), create() Batch auto-labeling jobs
client.quality_targets list(), get(), create(), update(), delete(), evaluate() Project quality targets
client.consensus get_summary(), list_scores(), compute(), get_config(), update_config() Consensus scoring
client.webhooks list(), get(), create(), update(), delete(), test() Manage webhook subscriptions
client.webhook_deliveries list(), get() Inspect webhook delivery logs

Documentation

Contributing

See CONTRIBUTING.md for development setup and guidelines.

License

MIT - see LICENSE for details.

Managed local upload sessions

client.datasets.create_from_local(...) and its CLI path negotiate managed upload protocol v2. The API selects storage for the organization and pins it to one dataset upload batch. Existing S3 form POST responses remain supported; opted-in organizations can receive PUT or fixed-size multipart sessions.

The SDK keeps the batch UUID in its local upload checkpoint, uploads at most two parts concurrently per file, and asks the API to verify completion before dataset creation. A retry resumes server-confirmed parts only when the local source stamp is unchanged. Changed files require a fresh batch. Signed URLs and credentials are never saved in checkpoints. This is local resume, not verified cross-machine resume. Existing checkpoints created before v2 finish using the legacy protocol. resume=False (CLI --no-resume) starts a fresh batch and transfers every file again. Previous remote objects are retained, and retired batch IDs stay in the local recovery state. Successful finalization removes that batch's file stamps; one stable lock per batch remains for safe concurrent checkpoint access.

Lower-level callers can pass the same dataset_upload_uid UUID to create_manual_upload_url, upload_files, and create_from_manual_upload. Keep organization_uid and the dataset name identical across those calls. Provider rollout and rollback remain server configuration changes; existing batch bindings remain valid when the selection flag changes. Bring-your-own bucket imports are unchanged.

Metadata

Release files for avala 0.11.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for avala 0.11.0
File Size Uploaded Provenance Actions
avala-0.11.0.tar.gz 443.7 kB With provenance Details for avala-0.11.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for avala 0.11.0
File Interpreter ABI Platform Actions
avala-0.11.0-py3-none-any.whl Python 3 none any Details for avala-0.11.0-py3-none-any.whl

Total release size: 725.8 kB

Release files / avala-0.11.0.tar.gz

Download URL avala-0.11.0.tar.gz
Size 443.7 kB
Tags Source
SHA-256 checksum
How to use checksums
bfcc672cf97ab9845675e481fd5e833f81ecff906e0d3cfbb4dbb45a175fb140
BLAKE2b-256 checksum
How to use checksums
d193f8920a8a3e669c4ebddfaf9ae5d62c157072a72e156e87cd6620d8852749
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 27, 2026.

Transparency log

Release files / avala-0.11.0-py3-none-any.whl

Download URL avala-0.11.0-py3-none-any.whl
Size 282.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
28ea7be3387082f9dfb2daa307129ff56c4d94c5f49db5dd448a430579cba4b2
BLAKE2b-256 checksum
How to use checksums
350a04460b7eb4adf8e7c6992f19fc8d27c2c2b2ef2e04dca2f295e0349f09a1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 27, 2026.

Transparency log

Security for avala 0.11.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for avala-0.11.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 27, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page