Metadata-Version: 2.4
Name: giftassetsdk
Version: 6.9.6.post1
Summary: Dynamic async SDK for GiftAsset API based on live OpenAPI
Author-email: KILLDABORNE <dev.nevermore696@email.com>
License: MIT
Project-URL: Homepage, https://github.com/GIFT-ASSET/gift_asset_api
Project-URL: Documentation, https://giftasset.gifts/docs
Keywords: giftasset,sdk,openapi,async,python
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: aiohttp>=3.10.11

﻿# 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

```bash
pip install giftassetsdk
```

## Quick start

```python
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:

1. Explicit body:
```python
await client.get_collection_offers(body={"collection_name": "Evil Eye"})
```

2. Direct kwargs (auto-packed into body):
```python
await client.get_collection_offers(collection_name="Evil Eye")
```

For path parameters:

```python
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-Key` is sent automatically for each request.
