{"id":24199,"library":"parameter-expansion-patched","title":"parameter-expansion-patched","description":"A Python library that implements shell-style parameter expansion (e.g., ${VAR:-default}, ${VAR#prefix}). It is a patched fork of the original parameter-expansion library, maintained for PyPI distribution. Current version 0.3.1, with occasional updates.","status":"active","version":"0.3.1","language":"python","source_language":"en","source_url":"https://github.com/nexB/parameter-expansion-patched","tags":["shell","parameter-expansion","string-interpolation","environment-variables"],"install":[{"cmd":"pip install parameter-expansion-patched","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"The original library is unmaintained; use the patched version with the underscored package name.","wrong":"from parameter_expansion import ParameterExpander","symbol":"ParameterExpander","correct":"from parameter_expansion_patched import ParameterExpander"}],"quickstart":{"code":"from parameter_expansion_patched import ParameterExpander\n\nexpander = ParameterExpander(env={'USER': 'alice', 'HOME': '/home/alice'})\nresult = expander.expand('Hello ${USER:-default}, your home is ${HOME}')\nprint(result)  # Hello alice, your home is /home/alice","lang":"python","description":"Creates a ParameterExpander with an environment dict, then expands a string with shell parameter syntax."},"warnings":[{"fix":"If you want to use the real environment, pass os.environ: ParameterExpander(env=os.environ).","message":"The expander does NOT access the actual OS environment by default. You must pass a dict or use os.environ explicitly. Failing to do so may lead to empty expansions.","severity":"gotcha","affected_versions":"all"},{"fix":"Check the documentation for supported syntax before relying on advanced patterns.","message":"The library only supports a subset of shell parameter expansion features. Known missing: ${!indirect}, ${parameter:offset:length}, ${parameter/pattern/string} substitution.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Install parameter-expansion-patched and import from parameter_expansion_patched.","cause":"Importing the old package name instead of the patched version.","error":"ModuleNotFoundError: No module named 'parameter_expansion'"},{"fix":"Ensure you are using parameter_expansion_patched (version 0.3.1) and that the class has an 'expand' method.","cause":"Using the class from the original unpatched library which has a different API.","error":"AttributeError: 'ParameterExpander' object has no attribute 'expand'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}