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

Metadata

Release files for bracex 3.2.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.2.1
File Size Uploaded Provenance Actions
bracex-3.2.1.tar.gz 32.7 kB With provenance Details for bracex-3.2.1.tar.gz

Built distribution (wheel)

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

Total release size: 45.2 kB

Release files / bracex-3.2.1.tar.gz

Download URL bracex-3.2.1.tar.gz
Size 32.7 kB
Tags Source
SHA-256 checksum
How to use checksums
07a9b2100ceecc0c24afa1a1714bf8d4a6abb43d592939455f662b682ac9baa4
BLAKE2b-256 checksum
How to use checksums
4dfc137095eb2f24ccf0b4db196abd9f5cfe74398a834af51d4bc4876e0beaf0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 3, 2026.

Transparency log

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

Download URL bracex-3.2.1-py3-none-any.whl
Size 12.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e8622d46b60ef6062b4091033f97a304e1b205e70c0285743c5038b73886a47e
BLAKE2b-256 checksum
How to use checksums
47ae30dd8b027b4032b27e81364de5b74bfbef50b3c84c6aa0ead351bbb3749c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 3, 2026.

Transparency log

Security for bracex 3.2.1

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for bracex-3.2.1.tar.gz

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 Nov 3, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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