Metadata-Version: 2.4
Name: xgift
Version: 0.3.4
Summary: Python библиотека для работы с xGift API
Author-email: aiofake <g3657775@gmail.com>
License: MIT License
        
        Copyright (c) 2026 aiofake
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/aiofake/xgift
Project-URL: Bug Tracker, https://github.com/aiofake/xgift/issues
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Operating System :: OS Independent
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: curl_cffi
Dynamic: license-file

# xgift - Python библиотека для работы с xGift API

Простая и удобная библиотека для получения информации о NFT-гифтах с платформы xGift.

**PyPI:** https://pypi.org/project/xgift/  

**GitHub:** https://github.com/aiofake/xgift

## Установка

```bash
pip install xgift
```

## Быстрый старт

### Пример 1: Получить цену гифта

```python
import asyncio
from xgift import Gift

async def main():
    client = Gift()
    price = await client.floorPrice("PlushPepe")
    print(f"PlushPepe floor price: {price} TON")
    await client.close()

asyncio.run(main())
```

### Пример 2: Получить информацию о нескольких гифтах

```python
import asyncio
from xgift import Gift

async def main():
    client = Gift()
    
    gifts = ["PlushPepe", "AstralShard"]
    prices = await client.floorPrice(gifts)
    
    for gift, price in zip(gifts, prices):
        print(f"{gift}: {price} TON")
    
    await client.close()

asyncio.run(main())
```

## Основные методы

### Класс Gift

```python
import asyncio
from xgift import Gift

async def main():
    client = Gift()
    
    # Получить floor price
    price = await client.floorPrice("PlushPepe")
    
    # Получить оценочную цену
    estimated_ton = await client.estimatedPrice("PlushPepe-1", asset="Ton")
    estimated_usd = await client.estimatedPrice("PlushPepe-1", asset="Usd")
    
    # Получить элементы коллекции
    models = await client.models_floor("PlushPepe")
    backdrops = await client.backdrops_floor("PlushPepe")
    symbols = await client.symbols_floor("PlushPepe")
    
    # График цены
    graph = await client.getFloorGraph("PlushPepe")
    
    # Проверка монохромности
    is_mono = await client.isMonochrome("PlushPepe-1")
    
    print(f"Price: {price}")
    await client.close()

asyncio.run(main())
```

### Класс GiftRaw (низкоуровневый API)

```python
import asyncio
from xgift import GiftRaw

async def main():
    raw = GiftRaw()
    
    # Прямые запросы к API
    gift_info = await raw.GiftInfo("PlushPepe-1")
    collection_info = await raw.CollectionInfo("PlushPepe")
    gifts_in_collection = await raw.CollectionGifts("PlushPepe")
    
    print(gift_info)
    await raw.close()

asyncio.run(main())
```

### Утилиты

```python
import asyncio
from xgift import tonRate, nfts, lottie

async def main():
    # Курс TON
    rate = await tonRate()
    print(f"TON rate: {rate}")
    
    # NFT
    names = await nfts("names")  # только names
    ids = await nfts("ids")      # только ids
    all_nfts = await nfts("all") # names + ids (по умолчанию)
    print(names)
    
    # Lottie анимация
    animation = await lottie("plushpepe-1")
    print(animation)

asyncio.run(main())
```
