Name | bracex JSON |
Version |
2.5.post1
JSON |
| download |
home_page | None |
Summary | Bash style brace expander. |
upload_time | 2024-09-28 21:41:22 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.8 |
license | None |
keywords |
bash
brace
expand
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
|
[![Donate via PayPal][donate-image]][donate-link]
[![Build][github-ci-image]][github-ci-link]
[![Coverage Status][codecov-image]][codecov-link]
[![PyPI Version][pypi-image]][pypi-link]
[![PyPI - Python Version][python-image]][pypi-link]
![License][license-image-mit]
# Bracex
Bracex is a brace expanding library (à la Bash) for Python. Brace expanding is used to generate arbitrary strings.
```console
$ echo {{a,b},c}d
ad bd cd
```
Bracex adds this ability to Python:
```python
>>> bracex.expand(r'file-{{a,b},c}d.txt')
['file-ad.txt', 'file-bd.txt', 'file-cd.txt']
```
and as a command:
```console
$ python3 -m bracex -0 "base/{a,b}/{1..2}" | xargs -0 mkdir -p
$ tree base/
base/
├── a
│ ├── 1
│ └── 2
└── b
├── 1
└── 2
```
- **Why Bracex over other solutions?**
Bracex actually follows pretty closely to how Bash processes braces. It is not a 1:1 implementation of how Bash
handles braces, but generally, it follows very closely. Almost all of the test cases are run through Bash first,
then our implementation is compared against the results Bash gives. There are a few cases where we have purposely
deviated. For instance, we are not handling Bash's command line inputs, so we are not giving special meaning to back
ticks and quotes at this time.
On the command line Bracex can handle more expansions than Bash itself.
## Install
```console
$ pip install bracex
```
## Documentation
Documentation is found here: https://facelessuser.github.io/bracex/.
## License
MIT License
[github-ci-image]: https://github.com/facelessuser/bracex/actions/workflows/build.yml/badge.svg?branch=master&event=push
[github-ci-link]: https://github.com/facelessuser/bracex/actions?query=workflow%3Abuild+branch%3Amaster
[codecov-image]: https://img.shields.io/codecov/c/github/facelessuser/bracex/master.svg?logo=codecov&logoColor=aaaaaa&labelColor=333333
[codecov-link]: https://codecov.io/github/facelessuser/bracex
[pypi-image]: https://img.shields.io/pypi/v/bracex.svg?logo=pypi&logoColor=aaaaaa&labelColor=333333
[pypi-link]: https://pypi.python.org/pypi/bracex
[python-image]: https://img.shields.io/pypi/pyversions/bracex?logo=python&logoColor=aaaaaa&labelColor=333333
[license-image-mit]: https://img.shields.io/badge/license-MIT-blue.svg?labelColor=333333
[donate-image]: https://img.shields.io/badge/Donate-PayPal-3fabd1?logo=paypal
[donate-link]: https://www.paypal.me/facelessuser
Raw data
{
"_id": null,
"home_page": null,
"name": "bracex",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "bash, brace, expand",
"author": null,
"author_email": "Isaac Muse <Isaac.Muse@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/d6/6c/57418c4404cd22fe6275b8301ca2b46a8cdaa8157938017a9ae0b3edf363/bracex-2.5.post1.tar.gz",
"platform": null,
"description": "[![Donate via PayPal][donate-image]][donate-link]\n[![Build][github-ci-image]][github-ci-link]\n[![Coverage Status][codecov-image]][codecov-link]\n[![PyPI Version][pypi-image]][pypi-link]\n[![PyPI - Python Version][python-image]][pypi-link]\n![License][license-image-mit]\n# Bracex\n\nBracex is a brace expanding library (\u00e0 la Bash) for Python. Brace expanding is used to generate arbitrary strings.\n\n```console\n$ echo {{a,b},c}d\nad bd cd\n```\n\nBracex adds this ability to Python:\n\n```python\n>>> bracex.expand(r'file-{{a,b},c}d.txt')\n['file-ad.txt', 'file-bd.txt', 'file-cd.txt']\n```\n\nand as a command:\n\n```console\n$ python3 -m bracex -0 \"base/{a,b}/{1..2}\" | xargs -0 mkdir -p\n$ tree base/\nbase/\n\u251c\u2500\u2500 a\n\u2502 \u251c\u2500\u2500 1\n\u2502 \u2514\u2500\u2500 2\n\u2514\u2500\u2500 b\n \u251c\u2500\u2500 1\n \u2514\u2500\u2500 2\n```\n\n- **Why Bracex over other solutions?**\n\n Bracex actually follows pretty closely to how Bash processes braces. It is not a 1:1 implementation of how Bash\n handles braces, but generally, it follows very closely. Almost all of the test cases are run through Bash first,\n then our implementation is compared against the results Bash gives. There are a few cases where we have purposely\n deviated. For instance, we are not handling Bash's command line inputs, so we are not giving special meaning to back\n ticks and quotes at this time.\n\n On the command line Bracex can handle more expansions than Bash itself.\n\n## Install\n\n```console\n$ pip install bracex\n```\n\n## Documentation\n\nDocumentation is found here: https://facelessuser.github.io/bracex/.\n\n## License\n\nMIT License\n\n[github-ci-image]: https://github.com/facelessuser/bracex/actions/workflows/build.yml/badge.svg?branch=master&event=push\n[github-ci-link]: https://github.com/facelessuser/bracex/actions?query=workflow%3Abuild+branch%3Amaster\n[codecov-image]: https://img.shields.io/codecov/c/github/facelessuser/bracex/master.svg?logo=codecov&logoColor=aaaaaa&labelColor=333333\n[codecov-link]: https://codecov.io/github/facelessuser/bracex\n[pypi-image]: https://img.shields.io/pypi/v/bracex.svg?logo=pypi&logoColor=aaaaaa&labelColor=333333\n[pypi-link]: https://pypi.python.org/pypi/bracex\n[python-image]: https://img.shields.io/pypi/pyversions/bracex?logo=python&logoColor=aaaaaa&labelColor=333333\n[license-image-mit]: https://img.shields.io/badge/license-MIT-blue.svg?labelColor=333333\n[donate-image]: https://img.shields.io/badge/Donate-PayPal-3fabd1?logo=paypal\n[donate-link]: https://www.paypal.me/facelessuser\n",
"bugtrack_url": null,
"license": null,
"summary": "Bash style brace expander.",
"version": "2.5.post1",
"project_urls": {
"Homepage": "https://github.com/facelessuser/bracex"
},
"split_keywords": [
"bash",
" brace",
" expand"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "4b028db98cdc1a58e0abd6716d5e63244658e6e63513c65f469f34b6f1053fd0",
"md5": "48e2fe45e48298fbf48b81b7487231ab",
"sha256": "13e5732fec27828d6af308628285ad358047cec36801598368cb28bc631dbaf6"
},
"downloads": -1,
"filename": "bracex-2.5.post1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "48e2fe45e48298fbf48b81b7487231ab",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 11558,
"upload_time": "2024-09-28T21:41:21",
"upload_time_iso_8601": "2024-09-28T21:41:21.016722Z",
"url": "https://files.pythonhosted.org/packages/4b/02/8db98cdc1a58e0abd6716d5e63244658e6e63513c65f469f34b6f1053fd0/bracex-2.5.post1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "d66c57418c4404cd22fe6275b8301ca2b46a8cdaa8157938017a9ae0b3edf363",
"md5": "c003aa94ba86a3b7785a228d050e386c",
"sha256": "12c50952415bfa773d2d9ccb8e79651b8cdb1f31a42f6091b804f6ba2b4a66b6"
},
"downloads": -1,
"filename": "bracex-2.5.post1.tar.gz",
"has_sig": false,
"md5_digest": "c003aa94ba86a3b7785a228d050e386c",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 26641,
"upload_time": "2024-09-28T21:41:22",
"upload_time_iso_8601": "2024-09-28T21:41:22.017685Z",
"url": "https://files.pythonhosted.org/packages/d6/6c/57418c4404cd22fe6275b8301ca2b46a8cdaa8157938017a9ae0b3edf363/bracex-2.5.post1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-09-28 21:41:22",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "facelessuser",
"github_project": "bracex",
"travis_ci": false,
"coveralls": true,
"github_actions": true,
"lcname": "bracex"
}