bracex


Namebracex JSON
Version 2.4 PyPI version JSON
download
home_page
SummaryBash style brace expander.
upload_time2023-09-02 01:32:25
maintainer
docs_urlNone
author
requires_python>=3.8
license
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]
[![Discord][discord-image]][discord-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/workflows/build/badge.svg?branch=master&event=push
[github-ci-link]: https://github.com/facelessuser/bracex/actions?query=workflow%3Abuild+branch%3Amaster
[discord-image]: https://img.shields.io/discord/678289859768745989?logo=discord&logoColor=aaaaaa&color=mediumpurple&labelColor=333333
[discord-link]:https://discord.gg/TWs8Tgr
[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": "",
    "name": "bracex",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "bash,brace,expand",
    "author": "",
    "author_email": "Isaac Muse <Isaac.Muse@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/90/8b/34d174ce519f859af104c722fa30213103d34896a07a4f27bde6ac780633/bracex-2.4.tar.gz",
    "platform": null,
    "description": "[![Donate via PayPal][donate-image]][donate-link]\n[![Discord][discord-image]][discord-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/workflows/build/badge.svg?branch=master&event=push\n[github-ci-link]: https://github.com/facelessuser/bracex/actions?query=workflow%3Abuild+branch%3Amaster\n[discord-image]: https://img.shields.io/discord/678289859768745989?logo=discord&logoColor=aaaaaa&color=mediumpurple&labelColor=333333\n[discord-link]:https://discord.gg/TWs8Tgr\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": "",
    "summary": "Bash style brace expander.",
    "version": "2.4",
    "project_urls": {
        "Homepage": "https://github.com/facelessuser/bracex"
    },
    "split_keywords": [
        "bash",
        "brace",
        "expand"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2bf58f99837b32e2badc189382774dbe6227fa01e1e928a7eff857fdc89d8a75",
                "md5": "dceb57b1f7ab21bff24e8630cdbb7882",
                "sha256": "efdc71eff95eaff5e0f8cfebe7d01adf2c8637c8c92edaf63ef348c241a82418"
            },
            "downloads": -1,
            "filename": "bracex-2.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "dceb57b1f7ab21bff24e8630cdbb7882",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 11608,
            "upload_time": "2023-09-02T01:32:23",
            "upload_time_iso_8601": "2023-09-02T01:32:23.902840Z",
            "url": "https://files.pythonhosted.org/packages/2b/f5/8f99837b32e2badc189382774dbe6227fa01e1e928a7eff857fdc89d8a75/bracex-2.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "908b34d174ce519f859af104c722fa30213103d34896a07a4f27bde6ac780633",
                "md5": "46e012109f255fb29bcaef8bf9c8f5c9",
                "sha256": "a27eaf1df42cf561fed58b7a8f3fdf129d1ea16a81e1fadd1d17989bc6384beb"
            },
            "downloads": -1,
            "filename": "bracex-2.4.tar.gz",
            "has_sig": false,
            "md5_digest": "46e012109f255fb29bcaef8bf9c8f5c9",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 26588,
            "upload_time": "2023-09-02T01:32:25",
            "upload_time_iso_8601": "2023-09-02T01:32:25.107454Z",
            "url": "https://files.pythonhosted.org/packages/90/8b/34d174ce519f859af104c722fa30213103d34896a07a4f27bde6ac780633/bracex-2.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-09-02 01:32:25",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "facelessuser",
    "github_project": "bracex",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "lcname": "bracex"
}
        
Elapsed time: 0.10885s