AILabTools SDK for Python (async)
Project description
AILabTools Python SDK (async)
Official async Python SDK for AILabTools APIs.
- Get an API key: AILabTools Developer Console
- Official API documentation: AILabTools API Docs
- Repository: AILabTools SDK on GitHub
Installation
pip install ailabtools-sdk
Quick Start
1. Get your API key
Create or copy your API key from the AILabTools developer console:
2. Configure your environment
export AILAB_API_KEY="your_api_key_here"
3. Call the API
import os
import asyncio
from ailabtools import AILabClient
async def main():
client = AILabClient(api_key=os.environ["AILAB_API_KEY"])
credits = await client.common.commonQueryCredits({})
print(credits.get("data"))
await client.aclose()
asyncio.run(main())
Example: Image Upscaling
import os
import asyncio
from ailabtools import AILabClient
async def main():
client = AILabClient(api_key=os.environ["AILAB_API_KEY"])
with open("./image.jpg", "rb") as image:
result = await client.image.imageLosslessEnlargement({
"image": image,
"upscaleFactor": "2",
})
print(result.get("data"))
await client.aclose()
asyncio.run(main())
Parameter Mapping
The SDK exposes camelCase parameters, for example upscaleFactor, and maps them to API field names such as upscale-factor internally.
File Uploads
File parameters support file-like objects with a read method, or bytes / bytearray.
Async Tasks
Async APIs return task_id. Poll results with commonQueryAsyncTaskResult({"taskId": ...}).
API Reference
- Official API docs: AILabTools API Documentation
- SDK API docs: AILabTools SDK Documentation
Testing
AILAB_API_KEY=xxx pytest -q
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
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 ailabtools_sdk-0.5.2.tar.gz.
File metadata
- Download URL: ailabtools_sdk-0.5.2.tar.gz
- Upload date:
- Size: 18.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
da0fdc5ddc13cb1098ecbbd459d0401bca067fbd619e9b2142c7f549f227b4a2
|
|
| MD5 |
5d359e76fd8d2c6961091f5e1b9c9f73
|
|
| BLAKE2b-256 |
adfc0a86a9fda49d38c018e6ac52da3f17bf6f9c1d3659abfd62c5e2beeeeb3b
|
File details
Details for the file ailabtools_sdk-0.5.2-py3-none-any.whl.
File metadata
- Download URL: ailabtools_sdk-0.5.2-py3-none-any.whl
- Upload date:
- Size: 19.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3ca4b0ce61cefd09c791174948fd65ff7c3e784a4fe5253e36b9e4974de3bc35
|
|
| MD5 |
ad339002f6c98a92e5d407b0bfbe99c8
|
|
| BLAKE2b-256 |
68b6b5c5355b299f87af32dbefcb7949ae702cf90a190e6e81f42a74b2de6f35
|