# 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-converter/main/src/singbox_converter/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,
)
print(converter.singbox_config)
converter.export_config(
path="/path/to/output/config",
# nodes_only=True
)
```
## 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)
Raw data
{
"_id": null,
"home_page": null,
"name": "PySingBoxConverter",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "singbox converter clash subconverter",
"author": null,
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/7a/43/21d513ddbd62cdb2c605f1523df22a11537fa70d422ec69d243671682fcd/pysingboxconverter-0.5.1.dev0.tar.gz",
"platform": null,
"description": "# SingBox Converter\n\nThe 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).\n\n## How to install\n\n```bash\npip install PySingBoxConverter\n```\n\n## Use in commandline\n\n#### Create a `providers.json` from [`providers-example.json`](https://raw.githubusercontent.com/dzhuang/sing-box-converter/main/src/singbox_converter/providers-example.json):\n\n```bash\ncp providers-example.json providers.json\n\nvi providers.json\n```\n\n#### Then run\n\n```bash\nsingbox_convert -t 1 -o config1.json\n```\n\n## Use in python code systematically\n\n```python\nfrom singbox_converter import SingBoxConverter\n\nconverter = SingBoxConverter(\n providers_config=\"/path/to/providers.json\",\n template=\"/path/to/template\",\n fetch_sub_ua=\"clash.meta\",\n # fetch_sub_fallback_ua=\"clash\",\n # export_config_folder=\"\",\n # export_config_name=\"my_config.json\",\n # auto_fix_empty_outbound=True,\n)\n\nprint(converter.singbox_config)\n\nconverter.export_config(\n path=\"/path/to/output/config\",\n # nodes_only=True\n)\n\n```\n\n\n## Thanks\nCredit goes to:\n- [Toperlock/sing-box-subscribe](https://github.com/Toperlock/sing-box-subscribe)\n- [gg4924/sing-box-subscribe](https://github.com/gg4924/sing-box-subscribe)\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "SingBox converter, Python",
"version": "0.5.1.dev0",
"project_urls": null,
"split_keywords": [
"singbox",
"converter",
"clash",
"subconverter"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "32374580b90a40235f77d04647da6e016859a260768f994818023d0be2f4c066",
"md5": "ca47c6fc6fa7a2eaf36710838d81c45f",
"sha256": "7ec0e2f3af10f57079c9f9f73530ee12caba00d2e3e71492e89d04a39997ebff"
},
"downloads": -1,
"filename": "PySingBoxConverter-0.5.1.dev0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "ca47c6fc6fa7a2eaf36710838d81c45f",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 46548,
"upload_time": "2025-02-09T08:06:54",
"upload_time_iso_8601": "2025-02-09T08:06:54.984890Z",
"url": "https://files.pythonhosted.org/packages/32/37/4580b90a40235f77d04647da6e016859a260768f994818023d0be2f4c066/PySingBoxConverter-0.5.1.dev0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "7a4321d513ddbd62cdb2c605f1523df22a11537fa70d422ec69d243671682fcd",
"md5": "9997049253c021f2d8a564001ebbab20",
"sha256": "d92b1602c86be3b0033f2917d1d8f6ddddae4c8af091b81d4e33fb3834e32bc2"
},
"downloads": -1,
"filename": "pysingboxconverter-0.5.1.dev0.tar.gz",
"has_sig": false,
"md5_digest": "9997049253c021f2d8a564001ebbab20",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 30045,
"upload_time": "2025-02-09T08:06:56",
"upload_time_iso_8601": "2025-02-09T08:06:56.737450Z",
"url": "https://files.pythonhosted.org/packages/7a/43/21d513ddbd62cdb2c605f1523df22a11537fa70d422ec69d243671682fcd/pysingboxconverter-0.5.1.dev0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-02-09 08:06:56",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "pysingboxconverter"
}