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.4.3.dev0.tar.gz (29.9 kB view hashes)

Uploaded Source

Built Distribution

PySingBoxConverter-0.4.3.dev0-py3-none-any.whl (46.4 kB view hashes)

Uploaded Python 3

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