Metadata-Version: 2.4
Name: aioxui
Version: 0.0.4
Summary: Async Python SDK for XUI panel API
Author: Javad
License: MIT
Project-URL: Homepage, https://github.com/DevJavad/aioxui
Project-URL: Repository, https://github.com/DevJavad/aioxui
Keywords: xui,vpn,api,async,sdk
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: aiohttp>=3.9
Requires-Dist: pydantic>=2.0
Requires-Dist: python-dateutil>=2.9
Requires-Dist: jdatetime>=6
Requires-Dist: hijridate>=2.6
Dynamic: license-file

# AioxUI

A lightweight async Python SDK for interacting with XUI panel APIs.

## Features
- Async client based on aiohttp
- Typed models using Pydantic
- Client management (create, update, delete)
- Traffic management utilities
- Inbound attach/detach support

## Installation

```bash
pip install aioxui
```

```bash
git clone https://github.com/DevJavad/aioxui.git
cd aioxui
pip install -e .
```

## Quick Start
```python
import asyncio

from aioxui import XUI

async def main():
    async with XUI(
        base_url="https://your-panel.com/",
        token="YOUR_TOKEN"
    ) as xui:

        client = await xui.client.get("Javad")
        print(client)

        clients = await xui.client.all()
        print(len(clients))

asyncio.run(main())
```

## Example: Create Client
```python
import asyncio
import os

from aioxui import XUI
from aioxui.models import Client
from aioxui.enums import UnitType
from aioxui.utils import DateTime, Storage
from dotenv import load_dotenv

load_dotenv()

url: str = os.getenv("URL")
token: str = os.getenv("TOKEN")

async def main():
    async with XUI(base_url=url, token=token) as xui:
        client = Client(
            totalGB=Storage.from_unit(10, UnitType.GB),
            expiryTime=DateTime.after(days=30),
            limitIp=3,
            tgId=12345678,  # Telegram user_id
        )

        add = await xui.client.add(inbound_id=[2, 3], client=client)
        print(add.email)
        print(add.sub_id)


asyncio.run(main())
```
