Skip to main content

Donate via PayPal Coverage Status PyPI Version PyPI - Python Version License

Bracex

Bracex is a brace expanding library (à la Bash) for Python. Brace expanding is used to generate arbitrary strings.

$ echo {{a,b},c}d
ad bd cd

Bracex adds this ability to Python:

>>> bracex.expand(r'file-{{a,b},c}d.txt')
['file-ad.txt', 'file-bd.txt', 'file-cd.txt']

and as a command:

$ 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

$ pip install bracex

Documentation

Documentation is found here: https://facelessuser.github.io/bracex/.

License

MIT License

Release files for bracex 3.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bracex 3.0.1
File Size Uploaded
bracex-3.0.1.tar.gz 44.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for bracex 3.0.1
File Interpreter ABI Platform
bracex-3.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 56.0 kB

Release files / bracex-3.0.1.tar.gz

Download URL bracex-3.0.1.tar.gz
Size 44.0 kB
Tags Source
SHA-256 checksum
How to use checksums
4e38e32392e4a4780fe15d644bfc7c8514057cfc3861e060b11814ce829c25e4
BLAKE2b-256 checksum
How to use checksums
ac015f394b8bcd6e5b92f73130990960423bbb19711f906bd9fe9ea5557c667c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 20, 2026.

Transparency log

Release files / bracex-3.0.1-py3-none-any.whl

Download URL bracex-3.0.1-py3-none-any.whl
Size 11.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6523ad83aeb5098a4ee597cff0f964442ff74e460bd3fafaffab6a013ff2288c
BLAKE2b-256 checksum
How to use checksums
b88f6f7273a7adb8d73fc8d21ede4376a3e475e52f98435c6007f69100dec8ca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 20, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

3.0.1 This release

2 release files

3.0

2 release files

2.7

2 release files

2.6

2 release files

2.5

2 release files

2.4

2 release files

2.3

2 release files

2.2.1

2 release files

2.2

2 release files

2.1.1

2 release files

2.1

2 release files

2.0.1

2 release files

2.0

2 release files

1.4

2 release files

1.3

2 release files

1.2

2 release files

1.1.1

2 release files

1.1

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page