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

Uploaded Python 3

File details

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

File metadata

  • Download URL: arato_client-1.0.6.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.6.tar.gz
Algorithm Hash digest
SHA256 d2d573d327103276b0e109163357ab201288a8c2a137908645e57bb2264c6565
MD5 2d620ae0682cfad6550dba5dce6ed399
BLAKE2b-256 73bd391155783a0031efe050b5bd71d4b5fb8a1a761233eb179df17744f23028

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: arato_client-1.0.6-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.6-py3-none-any.whl
Algorithm Hash digest
SHA256 8e7cf7041db58f0651840ff9182eaf2f5564910c65d279a7495ee4bb6813d768
MD5 80a29632d3301ef0b22050361c3a9103
BLAKE2b-256 cd9758e55e922c3140376c0fc339b83690fe7283211aafde473ff8f2c0b9ea83

See more details on using hashes here.

Provenance

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