Skip to main content

Async Python SDK for XUI panel API

Project description

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

from aioxui import XUI
from aioxui.models import Client
from aioxui.utils import GB, Timestamp


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

        client = Client(
            totalGB=GB.of(10),
            expiryTime=Timestamp.from_days(30),
            limitIp=3,
        )

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


asyncio.run(main())

Project details


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.2.tar.gz (7.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aioxui-0.0.2-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file aioxui-0.0.2.tar.gz.

File metadata

  • Download URL: aioxui-0.0.2.tar.gz
  • Upload date:
  • Size: 7.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for aioxui-0.0.2.tar.gz
Algorithm Hash digest
SHA256 f9ff657500109db6c2186dabc6f239c692ea634555dd50ea1f7d66b77272db08
MD5 b617e5188a1ce4d0280c10688fa68dac
BLAKE2b-256 a21eb01272fe627d5b6d313ae7b8bcc0e09f8960d5a16fe49c1def1a8574d64a

See more details on using hashes here.

File details

Details for the file aioxui-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: aioxui-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 7.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for aioxui-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c54a8d2492195743b904d70ad7259e3aac6a2a9d75b3ae5ab34430331b740983
MD5 045affca87b2178f8379df7bbed36c5c
BLAKE2b-256 16f53ccf8fe2184bc043b8c92e4baf70c94ff1c63c8f47565277c437c89d2c8c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page