skillfed

parameter-expansion-patched

Shell parameter expansion in Python. Patched by co-maintainer for a PyPI release.

parameter-expansion-patched v0.3.1 124.4K downloads/30d#11,872 on PyPI
Permissive license Apache-2.0 Abandoned released

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-patched

uv

uv add parameter-expansion-patched

poetry

poetry add parameter-expansion-patched

Installing 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

Development Status :: 5 - Production/StableLicense :: OSI Approved :: Apache Software LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9

Tags

shell parameter expansion pythonposix variable expansionbash parameter substitutionshell variable parsingparameter expansion libraryshell syntax evaluationvariable substitution without shell
shell-parsingparameter-expansionposix-compliance

More Text Processing packages