Metadata-Version: 2.1
Name: PySingBoxConverter
Version: 0.4.1.dev0
Summary: SingBox converter, Python
Home-page: 
Author: 
Author-email: 
License: MIT
Keywords: singbox converter clash subconverter
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Web Environment
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Description-Content-Type: text/markdown
Requires-Dist: requests
Requires-Dist: ruamel.yaml

# SingBox Converter

The code are refactored from [Toperlock/sing-box-subscribe](https://github.com/Toperlock/sing-box-subscribe) See [Documentation](https://github.com/Toperlock/sing-box-subscribe/blob/main/instructions/README.md).

## How to install

```bash
pip install PySingBoxConverter
```

## Use in commandline

#### Create a `providers.json` from [`providers-example.json`](https://raw.githubusercontent.com/dzhuang/sing-box-subscribe/main/providers-example.json):

```bash
cp providers-example.json providers.json

vi providers.json
```

#### Then run

```bash
singbox_convert -t 1 -o config1.json
```

## Use in python code systematically

```python
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,
)

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

```


## Thanks
Credit goes to:
- [Toperlock/sing-box-subscribe](https://github.com/Toperlock/sing-box-subscribe)
- [gg4924/sing-box-subscribe](https://github.com/gg4924/sing-box-subscribe)
