Skip to main content

xtlsapi

codecov CI

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.

Metadata

Release files for xtlsapi 3.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for xtlsapi 3.3.0
File Size Uploaded
xtlsapi-3.3.0.tar.gz 52.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for xtlsapi 3.3.0
File Interpreter ABI Platform
xtlsapi-3.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 211.5 kB

Release files / xtlsapi-3.3.0.tar.gz

Download URL xtlsapi-3.3.0.tar.gz
Size 52.1 kB
Tags Source
SHA-256 checksum
How to use checksums
a7ac3a6290808353b424d95f0a6a703e405920eca030345f9ba8dfcb82d2e2b8
BLAKE2b-256 checksum
How to use checksums
1fddabf6a9893b2da0af1df0340fa9da591ecc1af3bb3ad422ccfea9973340ce
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.7

Release files / xtlsapi-3.3.0-py3-none-any.whl

Download URL xtlsapi-3.3.0-py3-none-any.whl
Size 159.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4380f7d610e411c207269cdbec9aea80a1364ec4f0d5febcec6ebcfc30f090eb
BLAKE2b-256 checksum
How to use checksums
6b2f2a576ca72fe7519640b76794d1dc8b9c1d07e1ae827c9197b368e519b420
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.7

Release history Release notifications | RSS feed

This release

3.3.0 This release

2 release files

3.2.1

2 release files

3.2.0

2 release files

3.1.2

2 release files

3.1.1

2 release files

3.1.0

2 release files

3.0.4

2 release files

3.0.3

2 release files

3.0.2

2 release files

3.0.1

2 release files

2.0.0

2 release files

1.1.0

2 release files

1.0.14

2 release files

1.0.13

2 release files

1.0.12

2 release files

1.0.11

2 release files

1.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page