Skip to main content

This is a lightweight library that works as a connector to Yottalabs public API.

Project description

Yottalabs Public API Connector (Python)

A lightweight Python library for connecting to the Yottalabs public API.
Easily interact with /openapi/v1/* endpoints, with support for custom base URLs, request timeouts, HTTP proxies, and more.

Requirements

  • Python 3.8 or higher

Installation

pip install yottactl

Quickstart

from yotta.pod import PodApi

# API key is required for user data endpoints
client = PodApi(api_key='<api_key>')

params = {
    "image": "yottalabsai/pytorch:2.8.0-py3.11-cuda12.8.1-cudnn-devel-ubuntu22.04-2025090101",
    "gpu_type": "NVIDIA_L4_24G",
    "gpu_count": 1,
    "expose": [
        {"port": 22, "protocol": "SSH"}
    ]
}

response = client.new_pod(**params)
print(response)

Customization

  • Base URL:
    If not provided, defaults to https://api.yottalabs.ai.

  • Timeout:
    Set the timeout parameter (in seconds) to control how long to wait for a server response.
    By default, requests do not time out.

    client = PodApi(timeout=1)
    
  • Logging:
    Set the log level to DEBUG to log request URLs, payloads, and responses.

    client = PodApi(debug=True)
    

Error Handling

Two types of errors are raised:

  • yotta.error.ClientError
    Raised for 4XX client errors. Properties:

    • status_code: HTTP status code
    • error_code: Server error code (if available)
    • error_message: Server error message
    • header: Full response headers
    • error_data: Additional data (if provided)
  • yotta.error.ServerError
    Raised for 5XX server errors.

Contributing

Contributions are welcome! Please open issues or pull requests.

License

MIT

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

yottactl-0.1.6.tar.gz (24.6 kB view details)

Uploaded Source

Built Distribution

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

yottactl-0.1.6-py3-none-any.whl (42.6 kB view details)

Uploaded Python 3

File details

Details for the file yottactl-0.1.6.tar.gz.

File metadata

  • Download URL: yottactl-0.1.6.tar.gz
  • Upload date:
  • Size: 24.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for yottactl-0.1.6.tar.gz
Algorithm Hash digest
SHA256 b29d2819ce2c55eecf9b93c2a2b231e3c2560f3b83cdf3a6b2494279c7813ff0
MD5 d497875390ef26e92cdb1b5b3f1f3943
BLAKE2b-256 81888465b662c693bf9268345c5451367d6034151b51d8be93a225cfdb76f886

See more details on using hashes here.

File details

Details for the file yottactl-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: yottactl-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 42.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for yottactl-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 8e7dc87639f19f4811a3648b19cd539d8d9febb377f736cd8ac1fd44eb9a5f53
MD5 4ad69f60c1e6bdf6e6d0c30e323259a7
BLAKE2b-256 3e7b7cfd7eac2d55257728a053ddeed5ef2eb6eb8a44286a01f9e44bc090d54b

See more details on using hashes here.

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