Skip to main content

Managed Python SDK for V2Root Core, proxy configurations, and subscriptions

Project description

V2Root Python SDK 2.0

A managed, modular Python 3.10+ SDK for V2Root Core.

The package contains no DLL, SO, C source, or external Xray executable. On first use it downloads the correct official V2Root Core release for the current platform, verifies the release archive, and installs it in an application cache.

Architecture

  • v2root.core.CoreManager: discovery, install, update, activation and rollback
  • v2root.native.NativeCore: strict ctypes ABI and native memory ownership
  • v2root.client.V2RootClient: configuration, lifecycle, latency and metrics
  • v2root.V2ROOT: compatibility facade for applications written against 1.x

Automatic Installation

from v2root import V2RootClient

client = V2RootClient()  # Downloads the latest compatible core when required.
client.connect("vless://...")
print(client.status)
print(client.traffic)
client.stop()

Structured batch testing and subscription integration:

from v2root import SubscriptionManager, V2RootClient

subscriptions = SubscriptionManager()
source = subscriptions.add_subscription("https://example.com/subscription")

with V2RootClient() as client:
    results = client.test_subscription(subscriptions, source.id)
    best = subscriptions.best_config(max_latency=500)
    if best:
        client.connect(best.config_string)

All low-level failures use typed exceptions. explain_error(error) returns a structured explanation with corrective actions. Legacy numeric errors -1 through -7 remain documented and supported by the explainer.

The default cache is:

  • Windows: %LOCALAPPDATA%\V2Root\core
  • Linux: $XDG_CACHE_HOME/v2root/core or ~/.cache/v2root/core

Set V2ROOT_CORE_HOME to override it.

Core Management

from v2root import CoreManager

manager = CoreManager()
installed = manager.ensure()
update = manager.update()
versions = manager.installed()
previous = manager.rollback()

Pin a release or disable network installation:

manager.install("v2root-v26.6.15")
client = V2RootClient(auto_install=False)

An explicit development build can be loaded without installing it. The xray-* basename in this example is the ABI asset name currently published by V2Root Core; it does not refer to a separately installed Xray executable:

client = V2RootClient(core_path="/path/to/xray-linux-amd64.so")

Installation Security

The manager:

  1. Uses the official GitHub Releases API and release asset URL.
  2. Selects the exact OS and architecture package.
  3. Enforces download size limits.
  4. Rejects unsafe ZIP paths.
  5. Requires the binary, generated header, and SHA256SUMS.
  6. Verifies the binary and header SHA-256 digests.
  7. Installs into a temporary directory and activates atomically.
  8. Retains older releases for rollback.

License

MIT License. See LICENSE.

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

v2root-2.0.0.tar.gz (42.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

v2root-2.0.0-py3-none-any.whl (45.4 kB view details)

Uploaded Python 3

File details

Details for the file v2root-2.0.0.tar.gz.

File metadata

  • Download URL: v2root-2.0.0.tar.gz
  • Upload date:
  • Size: 42.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for v2root-2.0.0.tar.gz
Algorithm Hash digest
SHA256 382c2dbce9bc4dfac6aa3bc12d4006dbdeb9b71fc02eee582233bf846164d67b
MD5 5be564a9dc544a63073d7d4f01bc1601
BLAKE2b-256 0e58155b1ab485ec888c069510c8d2b79a289ddad2cf9588c73bcf2bb3e36658

See more details on using hashes here.

File details

Details for the file v2root-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: v2root-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 45.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for v2root-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e8d2936cb6004970ff21488b972096fc69ab5b5eb9dabff14860239c9eb310c7
MD5 17fc3fd1341d18383e63d6357c68217d
BLAKE2b-256 b286ab29f92c840f0f07d7de31056d02c403e8b6fdb53711b23e578beb209212

See more details on using hashes here.

Supported by

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