Skip to main content
The Exports resource provides methods to create, retrieve, and list data exports.

Methods

list

List all exports with pagination support.
client.exports.list(
    limit=None,
    cursor=None
) -> CursorPage[Export]
limit
int | None
Maximum number of exports to return per page
cursor
str | None
Pagination cursor for fetching the next page of results
CursorPage[Export]
CursorPage[Export]
A paginated list of exports. Use .items to access the export list, .next_cursor for pagination, and .has_more to check if more results exist.

Example

from avala import Avala

client = Avala(api_key="your-api-key")

# List all exports
page = client.exports.list()
for export in page.items:
    print(export.uid, export.status)

# List with pagination
page = client.exports.list(limit=20)

create

Create a new export for a project or dataset.
client.exports.create(
    project=None,
    dataset=None
) -> Export
project
str | None
UID of the project to export
dataset
str | None
UID of the dataset to export
Export
Export
The newly created export object. The export will be processed asynchronously.
You must specify either project or dataset (or both) when creating an export.

Example

# Export a project
export = client.exports.create(project="project-uid-123")
print(f"Export created: {export.uid}")
print(f"Status: {export.status}")

# Export a dataset
export = client.exports.create(dataset="dataset-uid-456")

# Export both
export = client.exports.create(
    project="project-uid-123",
    dataset="dataset-uid-456"
)
Export creation is an asynchronous operation. Use the get() method to poll the export status and retrieve the download URL when ready.

get

Retrieve a specific export by its UID.
client.exports.get(uid: str) -> Export
uid
str
required
The unique identifier of the export
Export
Export
The export object containing uid, status, download_url, and timestamps.

Example

export = client.exports.get("export-uid-123")

if export.status == "completed":
    print(f"Download URL: {export.download_url}")
elif export.status == "processing":
    print("Export is still processing...")
elif export.status == "failed":
    print("Export failed")

Async Usage

All methods are available in async form via client.async_exports:
import asyncio
from avala import AsyncAvala

async def main():
    client = AsyncAvala(api_key="your-api-key")
    
    # Create export
    export = await client.exports.create(project="project-uid-123")
    print(f"Export created: {export.uid}")
    
    # Poll until complete
    while export.status == "processing":
        await asyncio.sleep(5)
        export = await client.exports.get(export.uid)
    
    if export.status == "completed":
        print(f"Download: {export.download_url}")

asyncio.run(main())

Response Types

Export

uid
str
Unique identifier for the export
status
str | None
Current status of the export (e.g., “pending”, “processing”, “completed”, “failed”)
download_url
str | None
URL to download the export file (available when status is “completed”)
created_at
datetime | None
Timestamp when the export was created
updated_at
datetime | None
Timestamp when the export was last updated

CursorPage

items
list[T]
List of items in the current page
next_cursor
str | None
Cursor for fetching the next page (None if no more pages)
previous_cursor
str | None
Cursor for fetching the previous page
has_more
bool
Property indicating if more results are available

Common Patterns

Polling for Export Completion

import time

# Create export
export = client.exports.create(project="project-uid-123")

# Poll until complete
while export.status in ["pending", "processing"]:
    time.sleep(5)
    export = client.exports.get(export.uid)
    print(f"Status: {export.status}")

if export.status == "completed":
    print(f"Download URL: {export.download_url}")
else:
    print(f"Export failed with status: {export.status}")

Build docs developers (and LLMs) love