Skip to main content

Official Python SDK for the Avala API

Project description

Avala Python SDK

PyPI version Python CI License: MIT

Official Python SDK for the Avala API. Build and manage ML annotation datasets, projects, exports, and tasks programmatically.

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

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
export = client.exports.create(project="project-uid")
print(export.uid, export.status)

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

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 with CLI extras for a command-line interface:

pip install avala[cli]
avala configure                    # Interactive API key setup
avala datasets list                # List datasets
avala projects list                # List projects
avala exports create <project-uid> # Create an export
avala storage-configs list         # List storage configs
avala agents list                  # List automation agents
avala inference-providers list     # List inference providers
avala auto-label list              # List auto-label jobs
avala quality-targets list -p <uid> # List quality targets
avala consensus summary -p <uid>   # Get consensus summary
avala webhooks list                # List webhook subscriptions

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() Create 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

avala-0.5.1.tar.gz (54.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

avala-0.5.1-py3-none-any.whl (59.4 kB view details)

Uploaded Python 3

File details

Details for the file avala-0.5.1.tar.gz.

File metadata

  • Download URL: avala-0.5.1.tar.gz
  • Upload date:
  • Size: 54.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for avala-0.5.1.tar.gz
Algorithm Hash digest
SHA256 faa60fb08da33762a1837e083d5e717cc1b4ad2af007571ac6bf6eea0f1255e0
MD5 f62bb5c8b2c5e95e0816eb94a73bdc07
BLAKE2b-256 9ad140a4d744ec51011c89d3ce1c9abf643072f428a5c1606635485779ae0713

See more details on using hashes here.

File details

Details for the file avala-0.5.1-py3-none-any.whl.

File metadata

  • Download URL: avala-0.5.1-py3-none-any.whl
  • Upload date:
  • Size: 59.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for avala-0.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 dc801e874fff6621c526afd5a5999d5aa772f06b437538f28bd6bb03fe38ffd1
MD5 183431b92310e843d621fef93f4db5b7
BLAKE2b-256 930f7bb694fd1c55b1386d51f9d5ae13681cb0b400a1c9bdbdea7d0495b2b41c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page