# 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/79/80/8f4780e1a065d94d94b4cb333215031f78a85ac3a20cce9991de045a2b2e/pysingboxconverter-0.5.0.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.0.dev0",
"project_urls": null,
"split_keywords": [
"singbox",
"converter",
"clash",
"subconverter"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "f58c4fcfbabee139a4ce2e834f7cdb9e0bdeee5f3a906aba1dedcf5d074f6064",
"md5": "2e2bde56cf9ee922f08a46f45581c0a0",
"sha256": "5966d482cc5d0ae8a7e57e876edfa6cc63d02b668307ee23260bbfa90d4f2951"
},
"downloads": -1,
"filename": "PySingBoxConverter-0.5.0.dev0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "2e2bde56cf9ee922f08a46f45581c0a0",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 46504,
"upload_time": "2024-05-12T09:33:34",
"upload_time_iso_8601": "2024-05-12T09:33:34.907338Z",
"url": "https://files.pythonhosted.org/packages/f5/8c/4fcfbabee139a4ce2e834f7cdb9e0bdeee5f3a906aba1dedcf5d074f6064/PySingBoxConverter-0.5.0.dev0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "79808f4780e1a065d94d94b4cb333215031f78a85ac3a20cce9991de045a2b2e",
"md5": "e51e2aa6bb0c7540538a9e0b8068a12b",
"sha256": "261922dde98f480b3861491362811dfdf75ac5eb34f276e4223d5280410f0787"
},
"downloads": -1,
"filename": "pysingboxconverter-0.5.0.dev0.tar.gz",
"has_sig": false,
"md5_digest": "e51e2aa6bb0c7540538a9e0b8068a12b",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 30006,
"upload_time": "2024-05-12T09:33:36",
"upload_time_iso_8601": "2024-05-12T09:33:36.514754Z",
"url": "https://files.pythonhosted.org/packages/79/80/8f4780e1a065d94d94b4cb333215031f78a85ac3a20cce9991de045a2b2e/pysingboxconverter-0.5.0.dev0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-05-12 09:33:36",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "pysingboxconverter"
}