# 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/43/89/495fe09afccd4fc17265fbbf869022f3fb27a6d85451820195d5800099f1/yottactl-0.1.1.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.1",
"project_urls": {
"Homepage": "https://github.com/yottalabsai/yottactl"
},
"split_keywords": [
"yotta",
" public api"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "bdf77b25ad827919842efc0890c1b5aae94bc732650dd426cb05fb289fe16c7f",
"md5": "26ef45c17dcf7728afff9d81d2e1083b",
"sha256": "eae542ecbb8892e40de244265f656354de1f746d4692321bd9f786b3b3504530"
},
"downloads": -1,
"filename": "yottactl-0.1.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "26ef45c17dcf7728afff9d81d2e1083b",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 12999,
"upload_time": "2025-07-17T03:28:51",
"upload_time_iso_8601": "2025-07-17T03:28:51.696419Z",
"url": "https://files.pythonhosted.org/packages/bd/f7/7b25ad827919842efc0890c1b5aae94bc732650dd426cb05fb289fe16c7f/yottactl-0.1.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "4389495fe09afccd4fc17265fbbf869022f3fb27a6d85451820195d5800099f1",
"md5": "fc54fcd3cdaed911e18e8ec1b2011e28",
"sha256": "1aeaa395c7468ade33d00d3f8b0009f1a343d2c16d30ccd453499c346f4dd976"
},
"downloads": -1,
"filename": "yottactl-0.1.1.tar.gz",
"has_sig": false,
"md5_digest": "fc54fcd3cdaed911e18e8ec1b2011e28",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 11177,
"upload_time": "2025-07-17T03:28:52",
"upload_time_iso_8601": "2025-07-17T03:28:52.547734Z",
"url": "https://files.pythonhosted.org/packages/43/89/495fe09afccd4fc17265fbbf869022f3fb27a6d85451820195d5800099f1/yottactl-0.1.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-07-17 03:28:52",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "yottalabsai",
"github_project": "yottactl",
"github_not_found": true,
"lcname": "yottactl"
}