POSIX parameter expansion in Python
Project description
POSIX Parameter Expansion
NOTE: this is tepomrary advanced release
This is an experiment to create a Python library to enable POSIX parameter expansion from a string.
Obvious Test Cases
>>> from parameter_expansion import expand
>>> foo = 'abc/123-def.ghi'
>>> # Bland Expansion
>>> expand('abc $foo abc')
'abc abc/123-def.ghi abc'
>>> expand('abc${foo}abc')
'abcabc/123-def.ghiabc'
>>>
>>> # Default Value Expansion
>>> expand('-${foo:-bar}-')
'-abc/123-def.ghi-'
>>> expand('-${bar:-bar}-')
'-bar-'
Default Value Expansion
>>> foo = 'abc/123-def.ghi'
>>> expand('abc $foo abc')
'abc abc/123-def.ghi abc'
>>> expand('abc${foo}abc')
'abcabc/123-def.ghiabc'
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for parameter-expansion-patched-0.2.1b1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 68edd22e00bec014d38b0be9495f14e68fa6121b1fe725287a08cf2a289dfa7d |
|
MD5 | bf03d2ab9d7bff6d2ad4765ad5aebe6a |
|
BLAKE2b-256 | f55ab2c19048c927bbc9591fc2db4c6c0dae74dfd92d5c7395054aa7ffbc784b |
Close
Hashes for parameter_expansion_patched-0.2.1b1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3317272bf09f6d3fe3ca19164152e5ec356c3c7d7b1b49d9f5021e622081dcb9 |
|
MD5 | de8f3bd39e21b2b62d16338cb810253c |
|
BLAKE2b-256 | 51eb42e40dbd468199c1efd73f20709c0c1ddb52e8c2ff6aac61a003d69cc308 |