Skip to main content

Official Python SDK for the Avala API

Project description

Avala Python SDK

PyPI version Python License: MIT

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

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}")

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

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.2.0.tar.gz (17.1 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.2.0-py3-none-any.whl (21.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for avala-0.2.0.tar.gz
Algorithm Hash digest
SHA256 ae2082750b925ae97f5271fdd7d4b87b9cf1b348e4ebdb728942f897549646e5
MD5 4c2578836de08046f3bac5f09fa40930
BLAKE2b-256 4bf9f5370ec4ef87b79ec92d2a799c049fb075c34807a2cf2957a0b08d0f4ba0

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for avala-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cf79fbf3aba531fb33193a9aef8063398ecd952924f42521338916bd22e8b368
MD5 a65b1234a6fbedc71d68bdaf92b4d9d1
BLAKE2b-256 6c60d985570d3d2b4a5f2af8859698dab756f6ccfb01a4dcda0d080c0dc3657f

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