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

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

pip install .

This will install the SDK and its dependencies in your current Python environment.

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: arato_client-1.0.4.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.4.tar.gz
Algorithm Hash digest
SHA256 f8f9fea2239215c28a841f7d50aa0cfef160ea5be644929d984ca16f643797fe
MD5 bcbe34e14ca6e40d9f38655424a9bc00
BLAKE2b-256 7385cdc81fc30a6dfa6e0c64c3bf5a8f3a581bf984de6f6c33f5a62823440ac5

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: arato_client-1.0.4-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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 7f5fe302ab034d76a406016401a28479ac202ec48f40d6fbbacc94b15bf6b58e
MD5 2208532345e0b69682beddb1f5ca1a80
BLAKE2b-256 1d9ec791c9e98cbb94e1a5574d322674a5fae6f15b946e3aaa4fc1b7f21854a4

See more details on using hashes here.

Provenance

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