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

Uploaded Source

Built Distribution

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

Uploaded Python 2 Python 3

File details

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

File metadata

  • Download URL: envsubst-0.1.2.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.2.tar.gz
Algorithm Hash digest
SHA256 11e128697726b45e5711887adf48b53f15a3183bb06834c2864af5f5e1ea3978
MD5 1ea2fbfb770a233d0b951c903b900439
BLAKE2b-256 445a3367dab5df4528f47833ae00c42f15e2b92db5a01543e8fe614f234ce183

See more details on using hashes here.

File details

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

File metadata

  • Download URL: envsubst-0.1.2-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.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 d32bb0b978cb2b4c77c40421335f8a5cdfb6a81ae645930140e4ce40e95e989b
MD5 f99265e72598fa8291c1ef16a9eb9d3f
BLAKE2b-256 29706977b7f2a604779bca765e4d6185bcde0139a8e33523cbb3022db43e6685

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