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 tohttps://api.yottalabs.ai. -
Timeout:
Set thetimeoutparameter (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 toDEBUGto 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 codeerror_code: Server error code (if available)error_message: Server error messageheader: Full response headerserror_data: Additional data (if provided)
-
yotta.error.ServerError
Raised for 5XX server errors.
Contributing
Contributions are welcome! Please open issues or pull requests.
License
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file yottactl-0.1.2.tar.gz.
File metadata
- Download URL: yottactl-0.1.2.tar.gz
- Upload date:
- Size: 12.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4e6408cb2a10c4a40dc029c4c73161f183462473c3577017133e9191edfccca5
|
|
| MD5 |
1c5b474e89750766f803808046e36088
|
|
| BLAKE2b-256 |
d4ef16afbc47062672fd5c31f2b283821b322015c5f799444fc37290d5199c89
|
File details
Details for the file yottactl-0.1.2-py3-none-any.whl.
File metadata
- Download URL: yottactl-0.1.2-py3-none-any.whl
- Upload date:
- Size: 15.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e93f36a50c26f2acc3835674cd5ecc2a86fadec4b824791e080f83ff7d31d60a
|
|
| MD5 |
e5a0f2fb7f586d4ec1bdb862435e7673
|
|
| BLAKE2b-256 |
15712ef183b4c5107fd5526f3ae7f7f2f4ef8d4e86573411be0364d86a29673d
|