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.1b4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | fa177819ac4a8aa810fd9a31769887125d63e94bc2f27f154627ba2899861aee |
|
MD5 | c50685466a9ffeae0892a6cd1a896655 |
|
BLAKE2b-256 | ce3c8601cbb2e508f29f2d396abf8bf52c173ddc7fa771a4a5b15604e262b6d4 |
Close
Hashes for parameter_expansion_patched-0.2.1b4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2f7463c38f2e9f870e131230ebd38d4d9622ba9b284e7e31354abab731cf58ed |
|
MD5 | 2a097d81f853dd7e9f6fc67cd719c588 |
|
BLAKE2b-256 | 3fd14719be9272255ae2fe260d1ae524d6a4bf5f68ef5c64691374a653cd7550 |