Skip to main content

WhitelistHub

Official Python client for the WhitelistHub partner API.

  • Pure Python, no third-party dependencies
  • Keys, balance, pricing, dynamic VLESS API
  • HMAC verification for outbound panel webhooks

Install

pip install whitelisthub

Quickstart

from whitelisthub import PanelClient

client = PanelClient("https://whitelisthub.net", api_token="YOUR_TOKEN")
# [whitelisthub] whitelisthub.net — connected (42 ms) | balance 1500.00 RUB

key = client.keys.create(
    limit_gb=50,
    months=1,
    user_id="tg:1",
    idempotency_key="order-1",
)
print(key.subscription_url)

Disable the startup health check:

client = PanelClient(
    "https://whitelisthub.net",
    api_token="YOUR_TOKEN",
    auto_connect=False,
)

From environment (WHITELISTHUB_API_TOKEN, optional WHITELISTHUB_URL):

client = PanelClient.from_env()

Keys

client.keys.info(key.key_id)
client.keys.renew(key.key_id, months=1)
client.keys.expand(key.key_id, limit_gb=100)
client.keys.reset(key.key_id)
client.keys.ban(key.key_id, message="blocked")
client.keys.unban(key.key_id)
client.keys.delete(key.key_id)

Webhooks

The panel signs outbound events with X-Signature: sha256=<hmac> over the raw request body. Verify with the raw bytes (e.g. Flask request.get_data()), not a re-encoded JSON document.

from flask import Flask, request
from whitelisthub import verify_partner_webhook

app = Flask(__name__)

@app.post("/hooks/panel")
def panel_hook():
    data = verify_partner_webhook(
        request.get_data(),
        signature=request.headers.get("X-Signature"),
        secret="YOUR_WEBHOOK_SECRET",
        max_age_sec=600,
    )
    return {"ok": True, "event": data["event"]}

Docs

Metadata

Release files for whitelisthub 1.1.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 whitelisthub 1.1.0
File Size Uploaded Provenance
whitelisthub-1.1.0.tar.gz 11.9 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 25.2 kB

Release files / whitelisthub-1.1.0.tar.gz

Download URL whitelisthub-1.1.0.tar.gz
Size 11.9 kB
Tags Source
SHA-256 checksum
How to use checksums
cd00156fa471942754f53bcc2f07f95c19213dabb23961afc1aa7c96635d6893
BLAKE2b-256 checksum
How to use checksums
5c930a6fc6b7133bb36d8b7aef99cfbc76352885ee5beea8fc969e0e56158a85
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.0

Release files / whitelisthub-1.1.0-py3-none-any.whl

Download URL whitelisthub-1.1.0-py3-none-any.whl
Size 13.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
68688e050790f7c02139045de28bdb3081a84745f5e808e92f4282a378b480e4
BLAKE2b-256 checksum
How to use checksums
54e86fb32ec79b36ff016cc01835a69de1af36c3ea3369cf5921604a1f970389
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.0

Security for whitelisthub 1.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files No provenance

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