POSIX parameter expansion in Python
Project description
POSIX Parameter Expansion
This is an experiment to create a Python library to enable POSIX parameter expansion from a string.
Obvious Test Cases
>>> from pe 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-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | ad9e14daa00d67e5291b1daa386bdbbb973696a933357c19a29779e86c825b66 |
|
MD5 | 2d30f37b146607a11ddf67582d4c6873 |
|
BLAKE2b-256 | c8a89f57523431c879bb92d407a6ab412a93ccd3444c9201ef71df5ab6e715fc |
Close
Hashes for parameter_expansion-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 757b840670ac44a0aac91e5dbed90e59020071e502c16f0dcb28a34155213d74 |
|
MD5 | c388cc7bfbcfec1edf9e6134612a147c |
|
BLAKE2b-256 | 1851fccfc09cb8f5349635fbb9d07c4706e6e87d6273ed68fbb43c66d7a66218 |