--- id: bracex version: "3.0.1" license: MIT license_treatment: permissive maintenance: active --- # bracex — Bash style brace expander. License: permissive · Maintenance: active · Popularity: top 1,000 on PyPI ## Install pip install bracex uv add bracex poetry add bracex ## Description [![Donate via PayPal][donate-image]][donate-link] [![Coverage Status][codecov-image]][codecov-link] [![PyPI Version][pypi-image]][pypi-link] [![PyPI - Python Version][python-image]][pypi-link] [![License][license-image-mit]][license-link] # 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... ## AI interpretation — verify before relying Bracex expands Bash-style brace patterns into lists of strings, enabling programmatic generation of multiple variants from a single template expression. Verdict: Bracex is a stable, actively maintained library with zero dependencies and no known vulnerabilities. It fills a specific niche for Bash-style brace expansion in Python with permissive licensing and broad Python version support. [View on SkillFed](https://skillfed.io/packages/bracex) · [View on PyPI](https://pypi.org/project/bracex/)