Skip to main content

Awesome xtlsapi created by hiddify

Project description

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.

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

xtlsapi-3.3.0.tar.gz (52.1 kB view details)

Uploaded Source

Built Distribution

xtlsapi-3.3.0-py3-none-any.whl (159.3 kB view details)

Uploaded Python 3

File details

Details for the file xtlsapi-3.3.0.tar.gz.

File metadata

  • Download URL: xtlsapi-3.3.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

Hashes for xtlsapi-3.3.0.tar.gz
Algorithm Hash digest
SHA256 a7ac3a6290808353b424d95f0a6a703e405920eca030345f9ba8dfcb82d2e2b8
MD5 2afbde383a1e0cec79d20e7d0d9349a9
BLAKE2b-256 1fddabf6a9893b2da0af1df0340fa9da591ecc1af3bb3ad422ccfea9973340ce

See more details on using hashes here.

File details

Details for the file xtlsapi-3.3.0-py3-none-any.whl.

File metadata

  • Download URL: xtlsapi-3.3.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

Hashes for xtlsapi-3.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4380f7d610e411c207269cdbec9aea80a1364ec4f0d5febcec6ebcfc30f090eb
MD5 16de4f954c3575200a1aaffb45a7f951
BLAKE2b-256 6b2f2a576ca72fe7519640b76794d1dc8b9c1d07e1ae827c9197b368e519b420

See more details on using hashes here.

Supported by

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