Skip to main content

Substitue environment variables in a string

Project description

Substitue 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.0.tar.gz (2.3 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 2 Python 3

File details

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

File metadata

  • Download URL: envsubst-0.1.0.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.0.tar.gz
Algorithm Hash digest
SHA256 eb6a92c45bdee4c05fddcc51c11d6053d7576a4bb96bdaf2efc2eff00acbc153
MD5 17a8fc19a5fe2465c4320896fd59e34f
BLAKE2b-256 994110e306defab008ba166d329f2a087a8e79755fda936e3cb5512a60bea893

See more details on using hashes here.

File details

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

File metadata

  • Download URL: envsubst-0.1.0-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.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 d19565dd159a55120c785e40814d2d4d7e7de67130593adc201748bb7982a6b8
MD5 07cc4059d37864764cc8348edab476ca
BLAKE2b-256 240669a9f15f8e5b66e9009e2e9a590ee996ee8011c4976bbe7043c324a75d2a

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