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

Uploaded Python 3

File details

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

File metadata

  • Download URL: yottactl-0.1.4.tar.gz
  • Upload date:
  • Size: 13.3 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.4.tar.gz
Algorithm Hash digest
SHA256 8c73ba2e1afd9375bf3f95eb77bd839e43198bbadd8b023420fe8f9b260abdd4
MD5 9c8afafddf00c2aea9045473d226dc51
BLAKE2b-256 34fc11a4451001089ece9b4761a4533502ea3f437db6024e18b6768791851a9d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: yottactl-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 18.0 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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 cbac92fbd11f38928e6d2ea4c3cece0cd69fabc8b9c3073c01819901532ce6a9
MD5 ae712ca60daa16456264b1769a80cbe6
BLAKE2b-256 47455ec134193a06acb6e58f4de5618526a76850880157c7f642214bce70605e

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