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 details)
Built Distribution
File details
Details for the file expandvars-0.1.1.tar.gz
.
File metadata
- Download URL: expandvars-0.1.1.tar.gz
- Upload date:
- Size: 2.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 640fdf3c5195553241ecf0609abbeb77c6f606ac29f0374f1c9fe40b9dd6d31e |
|
MD5 | 03a5895173b2a94688c9eb9a058eea54 |
|
BLAKE2b-256 | ff74fb83eee2a95651b50fa7acc021bef8f70afae12010a1a4ccf3e439c54f9e |
File details
Details for the file expandvars-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: expandvars-0.1.1-py3-none-any.whl
- Upload date:
- Size: 2.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 48c98361c833945c50fedfc3cb3aaddae072480a5ee082caa51551610624ca70 |
|
MD5 | 9697ae807a351b6e26eaaa458679e615 |
|
BLAKE2b-256 | 34a6c33c7e01a395bae718a8cab4f5d49a27b4ce5e725ff1f501f9a090cc8d57 |