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-2025050802",
    "gpu_type": "NVIDIA_L4_24G",
    "gpu_count": 1,
    "expose": [
        {"port": 22, "protocol": "SSH"}
    ]
}

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

See the examples/ folder for more usage examples.

Configuration

To use the example scripts, create a examples/config.ini file with your API key:

[keys]
api_key=YOUR_API_KEY_HERE

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: yottactl-0.1.3.tar.gz
  • Upload date:
  • Size: 12.7 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.3.tar.gz
Algorithm Hash digest
SHA256 cfee380e20dd1f6e82bde054293db79acca5003252b708d4c0ae6c29e8e62cc8
MD5 98c295082b31cf0960ba33b0d281d28b
BLAKE2b-256 cdeff379f41982d75e7d5c124a260467749225012024e6f03869ba07b0f3d70c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yottactl-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 16.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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 775763e3084d185d19cec0b99efe7ac558877cde6f33d0fba14b81a9864f6b10
MD5 e657bcaf73ed8e12b7dc2219cad5eb91
BLAKE2b-256 d12d978543e40da735b2fd0fbf11e44e513d1a65762c8b72621cceeb59213c90

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