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

Uploaded Python 3

File details

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

File metadata

  • Download URL: arato_client-1.0.7.tar.gz
  • Upload date:
  • Size: 9.0 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.7.tar.gz
Algorithm Hash digest
SHA256 c3c7116b9e1893e7e859df5b97f18c0cad70bb5a5c0b375ab8cba4749115a620
MD5 1443843a818d87d929f05eb424198f03
BLAKE2b-256 d68e0080c40cb456726409cb8cbbee89d15708c1c69eb3ab33a7d238e073eef8

See more details on using hashes here.

Provenance

The following attestation bundles were made for arato_client-1.0.7.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.7-py3-none-any.whl.

File metadata

  • Download URL: arato_client-1.0.7-py3-none-any.whl
  • Upload date:
  • Size: 11.7 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.7-py3-none-any.whl
Algorithm Hash digest
SHA256 86863569ee071caa238ab27631dd898a3a50580ad1352c68c24722e29532ecec
MD5 2405d74d80708c5bd624b55d709de39e
BLAKE2b-256 4397f9d5b65a95fedc430daa8b0bafa77f34d9b3c03ccce888fb93dc8d8d9821

See more details on using hashes here.

Provenance

The following attestation bundles were made for arato_client-1.0.7-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