Skip to main content

The official Python Client for the Arato API for testing, experimenting, and evaluating LLM-based applications.

Project description

Arato Python SDK

The official Python SDK for the Arato API.

Arato is a platform for testing, experimenting, and evaluating LLM-based applications. This library provides a convenient, developer-friendly interface for interacting with Arato resources programmatically.

Installation

Install the SDK from PyPI using pip:

pip install arato-client

Or, to install from source, navigate to the root directory of this project (where pyproject.toml is located) and run:

pip install .

Usage

First, ensure you have your Arato API key. You can pass it directly to the client or set it as an environment variable named ARATO_API_KEY.

Synchronous Client

import os
from arato_client import AratoClient, NotFoundError

# Initialize the client (automatically uses ARATO_API_KEY env var)
# If the environment variable is not set, pass the key directly:
# client = AratoClient(api_key="your-arato-api-key")
client = AratoClient()

# List all notebooks
try:
    notebooks_response = client.notebooks.list()
    notebooks = notebooks_response.get('notebooks', [])
    print(f"Found {len(notebooks)} notebooks.")

    if notebooks:
        notebook_id = notebooks['id']

        # List experiments for the first notebook
        experiments_response = client.notebooks.experiments.list(notebook_id=notebook_id)
        experiments = experiments_response.get('experiments', [])
        print(f"Found {len(experiments)} experiments in notebook {notebook_id}.")

except NotFoundError as e:
    print(f"Error: A resource was not found. {e}")
except Exception as e:
    print(f"An unexpected error occurred: {e}")

Asynchronous Client

The SDK also provides an async client for use with asyncio.

import asyncio
from arato_client import AsyncAratoClient

async def main():
    async with AsyncAratoClient() as client:
        # List all notebooks
        notebooks_response = await client.notebooks.list()
        notebooks = notebooks_response.get('notebooks', [])
        print(f"Found {len(notebooks)} notebooks.")

if __name__ == "__main__":
    # Ensure ARATO_API_KEY is set in your environment before running
    if os.getenv("ARATO_API_KEY"):
        asyncio.run(main())
    else:
        print("Please set the ARATO_API_KEY environment variable.")

See example.py for a more detailed demonstration of the SDK's capabilities.

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

arato_client-1.0.9.tar.gz (12.4 kB view details)

Uploaded Source

Built Distribution

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

arato_client-1.0.9-py3-none-any.whl (11.9 kB view details)

Uploaded Python 3

File details

Details for the file arato_client-1.0.9.tar.gz.

File metadata

  • Download URL: arato_client-1.0.9.tar.gz
  • Upload date:
  • Size: 12.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for arato_client-1.0.9.tar.gz
Algorithm Hash digest
SHA256 7e8e0ac28250ccc60eeecf9392896ab8517e8d63397f4ef2f4a2c3af6e60736a
MD5 e36f22480d7db455d71932e7f91a8024
BLAKE2b-256 289fe4e305b9c80df94a352d6ebb800e93319528a5238f6122f50d678627b209

See more details on using hashes here.

Provenance

The following attestation bundles were made for arato_client-1.0.9.tar.gz:

Publisher: publish.yml on AratoAi/arato-python-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file arato_client-1.0.9-py3-none-any.whl.

File metadata

  • Download URL: arato_client-1.0.9-py3-none-any.whl
  • Upload date:
  • Size: 11.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for arato_client-1.0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 2b7bbfbcb213b735bc35a5234da544e11358d2f7b720a75b8ffb9304c95b9724
MD5 5c385e8f9d5dc93c6792b02918a5fecb
BLAKE2b-256 cc0fce72c7a53ee1ecff6ee518c812a38142112e9807edec345ce9bcc93ae8dd

See more details on using hashes here.

Provenance

The following attestation bundles were made for arato_client-1.0.9-py3-none-any.whl:

Publisher: publish.yml on AratoAi/arato-python-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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