skillfed

bracex

Bash style brace expander.

bracex Permissive license MIT Active 33 v3.0.1 released

Install

bracex on PyPI

pip

pip install bracex

uv

uv add bracex

poetry

poetry add bracex

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance actively maintained — 24 days since the last release
Last repo commit
First released
Popularity one of the top 1,000 most-downloaded packages on PyPI (30-day window, as of 2026-08-13)
Known vulnerabilities none known (OSV.dev, checked 2026-08-13)

Evidence: bracex-3.0.1-py3-none-any.whl

Keywords: bash, brace, expand

Development Status :: 5 - Production/StableEnvironment :: ConsoleIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Software Development :: Libraries :: Python ModulesTyping :: Typed

About bracex

from the package's own PyPI description — quoted content, verbatim

[![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.

$ 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...

Read as markdown · JSON record · Source repository · Homepage

AI interpretation — verify before relying

AI-generated interpretation of the package facts above; every digit, version, license, or vulnerability id it cites is grounded in the facts already shown on this page

Bracex expands Bash-style brace patterns into lists of strings, enabling programmatic generation of multiple variants from a single template expression.

Installation is straightforward with no runtime dependencies. The package is actively maintained, with a recent release (24 days ago) and ongoing repository activity.

MIT license permits free use, modification, and distribution with minimal restrictions, making it suitable for both open-source and commercial projects.

Usage

pip install bracex

import bracex
result = bracex.expand(r'file-{a,b,c}.txt')
print(result)  # ['file-a.txt', 'file-b.txt', 'file-c.txt']

Requires Python 3.10 or later.

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.

Needs verification

  • Whether the Bash compatibility claim ("follows pretty closely to how Bash processes braces") has been validated against real-world use cases beyond the test suite.
  • Performance characteristics when expanding very large or deeply nested brace patterns.
bash brace expansionstring pattern expansiongenerate string variantsbrace expander pythonbash-like expansiontemplate string expansion

Similar packages