parameter-expansion-patched
Shell parameter expansion in Python. Patched by co-maintainer for a PyPI release.
What it is and what it does
parameter-expansion-patched is a Python library that interprets POSIX and Bash shell parameter expansion syntax directly in strings, without invoking a shell subprocess. It parses strings containing variable references like `$var` or `${var}` and expands them using a provided dictionary or environment variables. The library supports standard expansions (variable substitution, default values via `${var:-default}`), Bash substrings, and string replacement operations.
The main use case is lightweight shell script analysis and parameter extraction in tools like build-script parsers, where spawning a shell would be a security risk or add unnecessary system dependencies. It handles a range of expansions through a custom parser, though it avoids extremely complex or ambiguous nested cases. The package has no runtime dependencies and installs easily, but has been abandoned for over four years despite being marked Production/Stable.
Use it for:
- Parse and expand shell variables in build scripts or configuration files without executing a shell.
- Extract and resolve parameter references in shell syntax during static code analysis or scanning.
- Evaluate shell-like variable substitution in a sandboxed, dependency-light environment.
- Support Bash parameter syntax (substrings, replacements) in Python string processing pipelines.
- Analyze shell scripts in security-sensitive contexts where subprocess spawning is undesirable.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Expands POSIX and Bash shell parameter syntax in Python strings without spawning a shell, supporting variable substitution, default values, substring operations, and string replacement.
Yes, if you need POSIX/Bash parameter expansion without shell spawning and can accept an abandoned codebase. The library is stable, has no dependencies, and handles a broad range of expansions. However, the 1563-day maintenance gap and lack of updates for modern Python versions beyond 3.10 mean you should verify it works with your target environment and have a plan for maintenance if issues arise.
Install
parameter-expansion-patched on PyPI
pip
pip install parameter-expansion-patcheduv
uv add parameter-expansion-patchedpoetry
poetry add parameter-expansion-patchedInstalling parameter-expansion-patched
Before you install
Low install friction with no runtime dependencies. Marked abandoned as of 1563 days since last release, though classified as Production/Stable and supported on Python 3.6–3.10.
License in practice
Apache-2.0 permissive license allows commercial and private use with minimal restrictions; suitable for most projects.
Quickstart
pip install parameter-expansion-patched
from parameter_expansion import expand
foo = 'abc/123-def.ghi'
result = expand('abc ${foo} abc')
Verify before relying
- Whether the abandoned status and 1563-day gap since last release pose maintenance or compatibility risks for modern Python versions beyond 3.10.
- Scope and completeness of nested expansion support claimed in the description.
- Performance characteristics when handling large or complex parameter strings.
Package facts
| License | Apache-2.0 (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | abandoned — 1,563 days since the last release |
| First released | |
| Downloads | 124,356/month — #11,872 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: parameter_expansion_patched-0.3.1-py3-none-any.whl
Keywords: parameter expansion, shell, POSIX, bash
Tags
More Text Processing packages
A drop-in replacement for Python's standard…
permissive · top 100 on PyPI
pyparsingpyparsing provides a library for building text…
permissive · top 1,000 on PyPI
docutilsDocutils converts plaintext documentation in…
unclear · top 1,000 on PyPI
RapidFuzzRapidFuzz provides fast fuzzy string matching…
permissive · top 1,000 on PyPI
tinycss2tinycss2 parses CSS strings into token and…
permissive · top 1,000 on PyPI
llama-parseLlamaParse parses complex documents (PDFs,…
permissive · top 1,000 on PyPI
expandvarsExpands Unix-style variable references in…
permissive · top 5,000 on PyPI
envsubstSubstitutes environment variables in strings…
permissive · top 15,000 on PyPI
bracexBracex expands Bash-style brace patterns into…
permissive · top 1,000 on PyPI
uri-templateExpands RFC 6570 URI Templates with variable…
permissive · top 1,000 on PyPI
contractionsExpands English contractions and slang into…
permissive · top 15,000 on PyPI
braceexpandExpands bash-style brace patterns into…
permissive · top 5,000 on PyPI
uritemplateExpands RFC 6570 URI templates by substituting…
permissive · top 1,000 on PyPI
codemod-toxParses and modifies tox.ini configuration…
permissive · top 15,000 on PyPI
bashlexbashlex parses bash shell syntax into an…
copyleft · top 5,000 on PyPI
oelint-parserParses BitBake recipe files and provides…
permissive · top 15,000 on PyPI