Skip to main content

Substitute environment variables in a string

Project description

Substitute environment variables in a string:

>>> import os
>>> from envsubst import envsubst

>>> del os.environ['PS1']
>>> print(envsubst('$USER@$HOST ${PS1:-$}:'))
ashafer01@github.com $:

>>> os.environ['PS1'] = ''
>>> print(envsubst('$USER@$HOST ${PS1:-$}:'))
ashafer01@github.com $:

>>> print(envsubst('$USER@$HOST ${PS1-foo}:'))
ashafer01@github.com :

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

envsubst-0.1.3.tar.gz (2.3 kB view details)

Uploaded Source

Built Distribution

envsubst-0.1.3-py2.py3-none-any.whl (3.5 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file envsubst-0.1.3.tar.gz.

File metadata

  • Download URL: envsubst-0.1.3.tar.gz
  • Upload date:
  • Size: 2.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.0

File hashes

Hashes for envsubst-0.1.3.tar.gz
Algorithm Hash digest
SHA256 bab66b225dbf7b5b4ec52d1e6b0635f79814d81ef5e94f87e95ea425f947b518
MD5 c37f9a810977745c8ff02cd07b494173
BLAKE2b-256 10aeb473f2a7783fc2be6182ed6ef18c65e31758a5f85f8f99330ede3f2b0b6a

See more details on using hashes here.

File details

Details for the file envsubst-0.1.3-py2.py3-none-any.whl.

File metadata

  • Download URL: envsubst-0.1.3-py2.py3-none-any.whl
  • Upload date:
  • Size: 3.5 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.0

File hashes

Hashes for envsubst-0.1.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 d8a3334bb4cb499249334c57ff45219789a4f5a3fcf38c88edef5a17acd759a5
MD5 d7c1d3a4e37bf68a9c9dd47e996138ba
BLAKE2b-256 9a0cbb1690f29ef153b4604dd85f6996c3a62ca4281ba1d31478313d8f6f94bd

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page