Skip to main content

SingBox converter, Python

Project description

SingBox Converter

The code are refactored from Toperlock/sing-box-subscribe See Documentation.

How to install

pip install PySingBoxConverter

Use in commandline

Create a providers.json from providers-example.json:

cp providers-example.json providers.json

vi providers.json

Then run

singbox_convert -t 1 -o config1.json

Use in python code systematically

from singbox_converter import SingBoxConverter

converter = SingBoxConverter(
    providers_config="/path/to/providers.json",
    template="/path/to/template",
    fetch_sub_ua="clash.meta",
    # fetch_sub_fallback_ua="clash",
    # export_config_folder="",
    # export_config_name="my_config.json",
    # auto_fix_empty_outbound=True,
)

print(converter.singbox_config)

converter.export_config(
    path="/path/to/output/config",
    # nodes_only=True
)

Thanks

Credit goes to:

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

pysingboxconverter-0.5.0.dev0.tar.gz (30.0 kB view details)

Uploaded Source

Built Distribution

PySingBoxConverter-0.5.0.dev0-py3-none-any.whl (46.5 kB view details)

Uploaded Python 3

File details

Details for the file pysingboxconverter-0.5.0.dev0.tar.gz.

File metadata

File hashes

Hashes for pysingboxconverter-0.5.0.dev0.tar.gz
Algorithm Hash digest
SHA256 261922dde98f480b3861491362811dfdf75ac5eb34f276e4223d5280410f0787
MD5 e51e2aa6bb0c7540538a9e0b8068a12b
BLAKE2b-256 79808f4780e1a065d94d94b4cb333215031f78a85ac3a20cce9991de045a2b2e

See more details on using hashes here.

File details

Details for the file PySingBoxConverter-0.5.0.dev0-py3-none-any.whl.

File metadata

File hashes

Hashes for PySingBoxConverter-0.5.0.dev0-py3-none-any.whl
Algorithm Hash digest
SHA256 5966d482cc5d0ae8a7e57e876edfa6cc63d02b668307ee23260bbfa90d4f2951
MD5 2e2bde56cf9ee922f08a46f45581c0a0
BLAKE2b-256 f58c4fcfbabee139a4ce2e834f7cdb9e0bdeee5f3a906aba1dedcf5d074f6064

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