Substitutes the values of environment variables. Python version.
- Fully compatible with envsubst
- Requires only Python itself and stdlib
- Supports POSIX syntax for default values
- Offers multiple quality-of-life features
Install the latest stable version via pip:
pip install pyenvsubstInstall the latest development version via pip:
pip install pip install pyenvsubst@git+https://github.com/Coacher/pyenvsubst.gitSubstitute environment variables from STDIN, output to STDOUT:
cat template.txt | pyenvsubstExclude specified environment variables from substitution, output to STDOUT:
cat template.txt | pyenvsubst --exclude "$API_TOKEN"Substitute environment variables from FOO.txt, output to BAR.txt:
pyenvsubst --input=FOO.txt --output=BAR.txt