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.1b3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | f9cf9404e72e8cc31f67646506ad722c03cdb07a7312d146816e15bd3b377e69 |
|
MD5 | b44d050917754c57d04c869be761906e |
|
BLAKE2b-256 | f9e30b212f007d31e076fb2529caaaac75b90e9152e9d2842d9926443b0bdb89 |
Close
Hashes for parameter_expansion_patched-0.2.1b3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8b19728c77ef756cf1da758f1ba785c41695660e4c84775187263bbf6a9eb240 |
|
MD5 | 76889e787c1f23d37a6f53b9fc1d42b7 |
|
BLAKE2b-256 | e91a272e8d59d58484a213928648504970025beb825156212562bac1b6fb317f |