Expand system variables Unix style
Project description
expandvars
Expand system variables Unix style
Inspiration
This module is inspired by GNU bash's variable expansion features. It can be used as an alternative to Python's os.path.expandvars function.
NOTE: Although it copies most of the common behaviours, it doesn't follow it strictly. For example, it doesn't work with arrays.
Usage
from expandvars import expandvars
print(expandvars("$PATH:$HOME/bin:${SOME_UNDEFINED_PATH:-/custom/path}"))
# /bin:/sbin:/usr/bin:/usr/sbin:/home/you/bin:/custom/path
Examples
For now, refer to the test cases to see how it behaves.
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
expandvars-0.1.1.tar.gz
(2.2 kB
view hashes)
Built Distribution
Close
Hashes for expandvars-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 48c98361c833945c50fedfc3cb3aaddae072480a5ee082caa51551610624ca70 |
|
MD5 | 9697ae807a351b6e26eaaa458679e615 |
|
BLAKE2b-256 | 34a6c33c7e01a395bae718a8cab4f5d49a27b4ce5e725ff1f501f9a090cc8d57 |