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 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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file parameter-expansion-0.2.0.tar.gz.
File metadata
- Download URL: parameter-expansion-0.2.0.tar.gz
- Upload date:
- Size: 9.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.7 CPython/3.9.0 Darwin/20.5.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2ec886a657d3ee49e40d68574b1a5390318071b0c7208daf9f1143eee26511ab
|
|
| MD5 |
80f5e39e7caf30e35a96aceaccaf66af
|
|
| BLAKE2b-256 |
4ff3f629b31fdac9ffd7c79339eac22f0449a42e6ea53e57bea019806e2be177
|
File details
Details for the file parameter_expansion-0.2.0-py3-none-any.whl.
File metadata
- Download URL: parameter_expansion-0.2.0-py3-none-any.whl
- Upload date:
- Size: 9.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.7 CPython/3.9.0 Darwin/20.5.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
40d33a6e892dca848ccb930167acec45859fe6965dd1058493e174ddcd8496ae
|
|
| MD5 |
3f63a19f88d07028695702b053ce24e0
|
|
| BLAKE2b-256 |
e799977fb7a03ba78d64de658707df1c52df8d85a965208ae5a80a5a3d4c6c3f
|