Skip to main content

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.

Metadata

Release files for v2root 2.0.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 v2root 2.0.0
File Size Uploaded
v2root-2.0.0.tar.gz 42.5 kB Details

Built distribution (wheel)

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

Total release size: 87.9 kB

Release files / v2root-2.0.0.tar.gz

Download URL v2root-2.0.0.tar.gz
Size 42.5 kB
Tags Source
SHA-256 checksum
How to use checksums
382c2dbce9bc4dfac6aa3bc12d4006dbdeb9b71fc02eee582233bf846164d67b
BLAKE2b-256 checksum
How to use checksums
0e58155b1ab485ec888c069510c8d2b79a289ddad2cf9588c73bcf2bb3e36658
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.9

Release files / v2root-2.0.0-py3-none-any.whl

Download URL v2root-2.0.0-py3-none-any.whl
Size 45.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e8d2936cb6004970ff21488b972096fc69ab5b5eb9dabff14860239c9eb310c7
BLAKE2b-256 checksum
How to use checksums
b286ab29f92c840f0f07d7de31056d02c403e8b6fdb53711b23e578beb209212
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.9

Release history Release notifications | RSS feed

This release

2.0.0 This release

2 release files

1.2.0

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.0

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