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.1.tar.gz
(52.1 kB
view details)
Built Distribution
xtlsapi-3.2.1-py3-none-any.whl
(159.3 kB
view details)
File details
Details for the file xtlsapi-3.2.1.tar.gz
.
File metadata
- Download URL: xtlsapi-3.2.1.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 | 7bdd425c44a476d3f009b6bfaeba96d244c257c2faa21b9ef499b60f15530819 |
|
MD5 | 966b1de65de8f42dfaafae250a4699e2 |
|
BLAKE2b-256 | a784e0c4f4126abf755a6472383bc1d90f4c24a910f6d2a3ed303b7526aeee75 |
File details
Details for the file xtlsapi-3.2.1-py3-none-any.whl
.
File metadata
- Download URL: xtlsapi-3.2.1-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 | 7b1575a1646d6f3362a94b8ad23084bc9db5dbfcbe996a3b7773ac8ff38ed2b9 |
|
MD5 | 23281793609e79ee76184ca1d397ce68 |
|
BLAKE2b-256 | 2dd70a7f3f04f43d8789e42acf749ea5cc8a6e7d368dd90d0f7a2e1055f68966 |