Awesome xtlsapi created by hiddify
Project description
xtlsapi
Python library to communicate with xray core
Install it from PyPI
pip install xtlsapi
Usage
from xtlsapi import XrayClient, utils, exceptions
xray_client = XrayClient('1.2.3.4', 1234)
user_id = utils.generate_random_user_id()
user_email = utils.generate_random_email()
inbound_tag = 'inbound-tag'
# Get stats
print(utils.human_readable_bytes(xray_client.get_client_download_traffic('user-email@mail.com')))
print(utils.human_readable_bytes(xray_client.get_client_upload_traffic('user-email@mail.com')))
print(utils.human_readable_bytes(xray_client.get_inbound_download_traffic(inbound_tag)))
print(utils.human_readable_bytes(xray_client.get_inbound_upload_traffic(inbound_tag)))
# Add & Remove client
user = xray_client.add_client(inbound_tag, user_id, user_email)
if user:
print(user)
xray_client.remove_client(inbound_tag, user_email)
# restart logger
xray_client.restart_logger()
Development
Read the CONTRIBUTING.md file.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
xtlsapi-3.2.0.tar.gz
(52.1 kB
view details)
Built Distribution
xtlsapi-3.2.0-py3-none-any.whl
(159.3 kB
view details)
File details
Details for the file xtlsapi-3.2.0.tar.gz
.
File metadata
- Download URL: xtlsapi-3.2.0.tar.gz
- Upload date:
- Size: 52.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2177edde696e32fda74cafc2efe49b163b556c209491fe69a4cbbf7f3c528491 |
|
MD5 | 2a50df3b54a10a227f6cdd49b21d0e41 |
|
BLAKE2b-256 | 4fa8e2282c8e17c6d24a855925ebabde323681db3099ccd47fc1439fa67c429a |
File details
Details for the file xtlsapi-3.2.0-py3-none-any.whl
.
File metadata
- Download URL: xtlsapi-3.2.0-py3-none-any.whl
- Upload date:
- Size: 159.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ae190b05d6317ce66628c3b891de0dbd413d2bbe5c20c074c6b05ccd6741a3e9 |
|
MD5 | 859fda3d657cb083e725383222bd6b69 |
|
BLAKE2b-256 | 90bc3fb73fb21beac0710947e69143767ffcb1d290ee341592b2180589e87fc2 |