# Yottalabs Public API Connector (Python)
A lightweight Python library for connecting to the [Yottalabs public API](https://api.yottalabs.ai).
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
```bash
pip install yottactl
```
## Quickstart
```python
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/`](examples/) folder for more usage examples.
## Configuration
To use the example scripts, create a `examples/config.ini` file with your API key:
```ini
[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.
```python
client = PodApi(timeout=1)
```
- **Logging:**
Set the log level to `DEBUG` to log request URLs, payloads, and responses.
```python
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](LICENSE)
Raw data
{
"_id": null,
"home_page": "https://github.com/yottalabsai/yottactl",
"name": "yottactl",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "yotta, Public API",
"author": null,
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/94/e7/9becd563c025f5d000e2b17686f71575e02c489a6f1399658dc0112cb638/yottactl-0.1.5.tar.gz",
"platform": null,
"description": "# Yottalabs Public API Connector (Python)\n\nA lightweight Python library for connecting to the [Yottalabs public API](https://api.yottalabs.ai). \nEasily interact with `/openapi/v1/*` endpoints, with support for custom base URLs, request timeouts, HTTP proxies, and more.\n\n\n## Requirements\n\n- Python 3.8 or higher\n\n## Installation\n\n```bash\npip install yottactl\n```\n\n## Quickstart\n\n```python\nfrom yotta.pod import PodApi\n\n# API key is required for user data endpoints\nclient = PodApi(api_key='<api_key>')\n\nparams = {\n \"image\": \"yottalabsai/pytorch:2.8.0-py3.11-cuda12.8.1-cudnn-devel-ubuntu22.04-2025050802\",\n \"gpu_type\": \"NVIDIA_L4_24G\",\n \"gpu_count\": 1,\n \"expose\": [\n {\"port\": 22, \"protocol\": \"SSH\"}\n ]\n}\n\nresponse = client.new_pod(**params)\nprint(response)\n```\n\nSee the [`examples/`](examples/) folder for more usage examples.\n\n## Configuration\n\nTo use the example scripts, create a `examples/config.ini` file with your API key:\n\n```ini\n[keys]\napi_key=YOUR_API_KEY_HERE\n```\n\n## Customization\n\n- **Base URL:** \n If not provided, defaults to `https://api.yottalabs.ai`.\n\n- **Timeout:** \n Set the `timeout` parameter (in seconds) to control how long to wait for a server response. \n By default, requests do not time out.\n\n ```python\n client = PodApi(timeout=1)\n ```\n\n- **Logging:** \n Set the log level to `DEBUG` to log request URLs, payloads, and responses.\n\n ```python\n client = PodApi(debug=True)\n ```\n\n## Error Handling\n\nTwo types of errors are raised:\n\n- `yotta.error.ClientError` \n Raised for 4XX client errors. Properties:\n - `status_code`: HTTP status code\n - `error_code`: Server error code (if available)\n - `error_message`: Server error message\n - `header`: Full response headers\n - `error_data`: Additional data (if provided)\n\n- `yotta.error.ServerError` \n Raised for 5XX server errors.\n\n## Contributing\n\nContributions are welcome! Please open issues or pull requests.\n\n## License\n\n[MIT](LICENSE)\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "This is a lightweight library that works as a connector to Yottalabs public API.",
"version": "0.1.5",
"project_urls": {
"Homepage": "https://github.com/yottalabsai/yottactl"
},
"split_keywords": [
"yotta",
" public api"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "bcd0529f9a744cf38dbf4d325b6f01baf64aa0f725d775c6b33112af8ddf0c1c",
"md5": "3979a7d01bae691fcdb77383cf515d34",
"sha256": "796a3437547f5ada18492f4d6357a48c6e43536741add9d76b8cda21f4e572f0"
},
"downloads": -1,
"filename": "yottactl-0.1.5-py3-none-any.whl",
"has_sig": false,
"md5_digest": "3979a7d01bae691fcdb77383cf515d34",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 18116,
"upload_time": "2025-10-14T10:22:43",
"upload_time_iso_8601": "2025-10-14T10:22:43.343877Z",
"url": "https://files.pythonhosted.org/packages/bc/d0/529f9a744cf38dbf4d325b6f01baf64aa0f725d775c6b33112af8ddf0c1c/yottactl-0.1.5-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "94e79becd563c025f5d000e2b17686f71575e02c489a6f1399658dc0112cb638",
"md5": "21d100993ff72ed519addbe97a5c5ce1",
"sha256": "3fab6aa7946d72563b906035be351d09ed281a139c0ea247e75a8cae4031f5f5"
},
"downloads": -1,
"filename": "yottactl-0.1.5.tar.gz",
"has_sig": false,
"md5_digest": "21d100993ff72ed519addbe97a5c5ce1",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 13360,
"upload_time": "2025-10-14T10:22:44",
"upload_time_iso_8601": "2025-10-14T10:22:44.199508Z",
"url": "https://files.pythonhosted.org/packages/94/e7/9becd563c025f5d000e2b17686f71575e02c489a6f1399658dc0112cb638/yottactl-0.1.5.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-10-14 10:22:44",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "yottalabsai",
"github_project": "yottactl",
"github_not_found": true,
"lcname": "yottactl"
}