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
pip install aioxui
git clone https://github.com/your-repo/aioxui.git
cd aioxui
pip install -e .
Quick Start
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
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())
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
aioxui-0.0.3.tar.gz
(7.9 kB
view details)
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 aioxui-0.0.3.tar.gz.
File metadata
- Download URL: aioxui-0.0.3.tar.gz
- Upload date:
- Size: 7.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c673783c9c4b7378428a6d8908eb63eb39f5834d6bace47ad61ba67e678230f9
|
|
| MD5 |
ba654cab6c9adbe7d63e7678d3b098e4
|
|
| BLAKE2b-256 |
081ceb5b4ce79e3cc183f3c4b768714804859fa713e1a7a6b64ff8a4cc3c541a
|
File details
Details for the file aioxui-0.0.3-py3-none-any.whl.
File metadata
- Download URL: aioxui-0.0.3-py3-none-any.whl
- Upload date:
- Size: 8.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
436f69e672dc5e908f0605c006bfa835fb1d759b5e1114380af3caae3d47e764
|
|
| MD5 |
550792f8908f11c82055be9bc864da7f
|
|
| BLAKE2b-256 |
8c01b1ad8ba547a815b05f34b488bfc0332ddeb8820ac933e0b0dc998b9389b7
|