Overview
V2Kit is a lightweight and extensible Python toolkit for working with V2Ray proxy configurations and subscriptions. It provides a clean API for common operations such as protocol detection, configuration validation, config relabeling, and subscription encoding/decoding. The project is designed with simplicity, predictability, and composability in mind, making it suitable for automation scripts, proxy pipelines, networking tools, and future extensions around V2Ray ecosystem utilities.
| PyPI Counter | |
| Github Stars |
| Branch | main | dev |
| CI |
| Code Quality |
Installation
Source Code
- Download Version 0.6 or Latest Source
pip install .
PyPI
- Check Python Packaging User Guide
pip install v2kit==0.6
Supported Protocols
V2Kit currently supports the following protocols:
| Protocol | Detection | Parsing | Relabeling | Config Model |
|---|---|---|---|---|
| VMESS | ✅ | ✅ | ✅ | ✅ |
| VLESS | ✅ | ✅ | ✅ | ✅ |
| Trojan | ✅ | ✅ | ✅ | ✅ |
| Shadowsocks | ✅ | ✅ | ✅ | ✅ |
| SOCKS | ✅ | ✅ | ✅ | ✅ |
| HTTP | ✅ | ✅ | ✅ | ✅ |
Usage
URI Utilities
from v2kit import (
decode_subscription,
encode_subscription,
is_vmess,
parse,
relabel,
)
uri = "vmess://eyJhZGQiOiIxMjcuMC4wLjEiLCJwcyI6Im9sZCJ9"
new_uri = relabel(uri, "Germany-1")
if is_vmess(new_uri):
print("VMESS URI detected")
config = parse(new_uri)
config.update_label("Germany-2")
subscription = encode_subscription([config])
uris = decode_subscription(subscription)
Configs
from v2kit import VMESSConfig
config = VMESSConfig(
uuid="550e8400-e29b-41d4-a716-446655440000",
address="example.com",
port=443,
label="Germany-1",
)
uri = config.to_uri()
Issues & Bug Reports
Just fill an issue and describe it. We'll check it ASAP!
- Please complete the issue template
Show Your Support
Star This Repo
Give a ⭐️ if this project helped you!
Donate to Our Project
Bitcoin
1KtNLEEeUbTEK9PdN6Ya3ZAKXaqoKUuxCyEthereum
0xcD4Db18B6664A9662123D4307B074aE968535388Litecoin
Ldnz5gMcEeV8BAdsyf8FstWDC6uyYR6pgZDoge
DDUnKpFQbBqLpFVZ9DfuVysBdr249HxVDhTron
TCZxzPZLcJHr2qR3uPUB1tXB6L3FDSSAx7Ripple
rN7ZuRG7HDGHR5nof8nu5LrsbmSB61V1qqBinance Coin
bnb1zglwcf0ac3d0s2f6ck5kgwvcru4tlctt4p5qefTether
0xcD4Db18B6664A9662123D4307B074aE968535388Dash
Xd3Yn2qZJ7VE8nbKw2fS98aLxR5M6WUU3sStellar
GALPOLPISRHIYHLQER2TLJRGUSZH52RYDK6C3HIU4PSMNAV65Q36EGNLZilliqa
zil1knmz8zj88cf0exr2ry7nav9elehxfcgqu3c5e5Coffeete
Changelog
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
Unreleased
0.6 - 2026-09-01
Added
clear_extramethodset_extra_itemmethodget_extra_itemmethodremove_extra_itemmethod
Changed
_get_protocolfunction modifieddecode_subscriptionfunction blank line bug fixed- Port validation bug fixed
- AlterId validation bug fixed
- Test system modified
- Parsers updated
0.5 - 2026-07-31
Added
encoded_labelpropertyuri_labelproperty
Changed
encode_subscriptionfunction modifiedparsefunction modifiedextraproperty modifiedupdate_extramethod modifiedto_urimethod modifiedto_dictmethod modifiedProtocolenum updated- Scheme bug fixed
- VMESS parser bug fixed
- Test system modified
0.4 - 2026-07-02
Added
HttpConfigclass
Changed
parsefunction modifiedREADME.mdupdated- Test system modified
0.3 - 2026-06-16
Added
- Logo
SocksConfigclassis_socksfunction
Changed
README.mdupdated- Test system modified
- Dependencies structure modified
- All config models moved to
modelsfolder
0.2 - 2026-06-04
Added
VMESSConfigclassVLESSConfigclassTrojanConfigclassShadowsocksConfigclassV2kitErrorclassV2kitValidationErrorclassV2kitParseErrorclassparsefunction
Changed
README.mdupdated- Test system modified
is_vmessfunctionconfigparameter renamed touriis_vlessfunctionconfigparameter renamed touriis_trojanfunctionconfigparameter renamed touriis_shadowsocksfunctionconfigparameter renamed touriencode_subscriptionfunctionconfigsparameter renamed toentries
0.1 - 2026-05-16
Added
is_vmessfunctionis_vlessfunctionis_trojanfunctionis_shadowsocksfunctionrelabelfunctionencode_subscriptionfunctiondecode_subscriptionfunction
Metadata
Release files for v2kit 0.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| v2kit-0.6.tar.gz | 21.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| v2kit-0.6-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 40.6 kB
Release files / v2kit-0.6.tar.gz
| Download URL | v2kit-0.6.tar.gz |
|---|---|
| Size | 21.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f49346d1dc628e0ec1a6a9050e6628d881887d5a2873619185b33dfc6da6cc64
|
|
BLAKE2b-256 checksum How to use checksums |
0608ad4cbce48a739cc7adc5bfd02769c7f807e14c20bbe9d8dfe4c6f159fa9f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|
Release files / v2kit-0.6-py3-none-any.whl
| Download URL | v2kit-0.6-py3-none-any.whl |
|---|---|
| Size | 19.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
921e968afd7c31e11bbacb8b303acc34a0b91ff1f4f2002b078f391a48445df8
|
|
BLAKE2b-256 checksum How to use checksums |
a9e5213b507bcacc7b3a1d06f5c9b04cea665a20480761306e2a1922443d0eb1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.7
|