Dynamic async SDK for GiftAsset API based on live OpenAPI
Project description
giftassetsdk 6.9.6
Dynamic async SDK for GiftAsset API.
The SDK loads the live OpenAPI schema from:
https://giftasset.gifts/openapi.json
and builds method mapping in memory for the current process runtime.
Install
pip install giftassetsdk
Quick start
import asyncio
from giftasset_sdk import SDK
async def main():
client = SDK(api_key="YOUR_API_KEY")
await client.initialize()
gift = await client.get_gift_by_name(name="EasterEgg-1")
print(gift["telegram_gift_name"])
# Optional: inspect available methods loaded from OpenAPI
print(len(client.list_methods()))
print(client.list_methods()[:10])
await client.close()
asyncio.run(main())
Calling any method from OpenAPI
Method names are resolved from OpenAPI path names. Example:
/api/v1/gifts/get_gift_by_name -> client.get_gift_by_name(...)
If endpoint has request body, you can pass body in 2 ways:
- Explicit body:
await client.get_collection_offers(body={"collection_name": "Evil Eye"})
- Direct kwargs (auto-packed into body):
await client.get_collection_offers(collection_name="Evil Eye")
For path parameters:
image_bytes = await client.data(
collection_shortname="artisanbrick",
attribute_type="models",
attribute_name="fightclub.png",
)
Notes
- Initialization fetches OpenAPI and creates temporary in-memory map.
- No hardcoded endpoint catalog in source.
X-API-Keyis sent automatically for each request.
Project details
Release history Release notifications | RSS feed
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 giftassetsdk-6.9.6.post1.tar.gz.
File metadata
- Download URL: giftassetsdk-6.9.6.post1.tar.gz
- Upload date:
- Size: 5.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
50f9b4955c44e5dfc6509d61891e55e54bd7a41c4afbe3a953c9b919a3ca4c16
|
|
| MD5 |
4a989d733347a9bc98cc7df5004400d5
|
|
| BLAKE2b-256 |
0c4dd7b5e2cc729ac8bf2d7bea9477e852f53fd72fb9d8d730756329483de405
|
File details
Details for the file giftassetsdk-6.9.6.post1-py3-none-any.whl.
File metadata
- Download URL: giftassetsdk-6.9.6.post1-py3-none-any.whl
- Upload date:
- Size: 5.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0fbd53a2781895073c5ca7ae2e026daf6c06fb023183b55891cbe9fee01e1ceb
|
|
| MD5 |
c7fb4a294199c06258b6ecbc3d993c5c
|
|
| BLAKE2b-256 |
cbb48bfa8809cc0f4798cc5bd842e86939e00bc9253222407fe1af4b4a17d435
|