Skip to main content

A python library to read and parse environment variables

Project description

PyPI version Build/Lint/Test

envutils

This python library contains some utils functions to read and parse environment variables.

It can be installed with:

pip3 install envutils

Usage examples:

# Set some example values for demonstration purposes
>>> import os
>>> os.environ['MY_ENV'] = 'my_value'
>>> os.environ['MY_INT_ENV'] = '42'
>>> os.environ['MY_BOOL_ENV'] = 'True'

>>> from envutils import envutils

# Read env variable as string
>>> envutils.get_from_environment('MY_ENV', 'my_default_value')
'my_value'

# Read env variable as int
>>> envutils.get_int_from_environment('MY_INT_ENV', 666)
42

# Read env variable as boolean
>>> envutils.get_bool_from_environment('MY_BOOL_ENV', False)
True

# Read a non-existing env variable
>>> envutils.get_from_environment('UNSET_ENV', 'my_default_value')
'my_default_value'

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

envutils-1.0.0.tar.gz (2.4 kB view details)

Uploaded Source

Built Distribution

envutils-1.0.0-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file envutils-1.0.0.tar.gz.

File metadata

  • Download URL: envutils-1.0.0.tar.gz
  • Upload date:
  • Size: 2.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.9.1

File hashes

Hashes for envutils-1.0.0.tar.gz
Algorithm Hash digest
SHA256 5171dcc4f05048562540b6c1bd09fa58ebb96257f560e1757943a5ebf3188ef3
MD5 60b92f9501c284d3b3d5226d8bc4d3d5
BLAKE2b-256 7fb30e2514ac99caa1102fb10cc892934bcc8b8d3ce7710e63095bd235e844db

See more details on using hashes here.

File details

Details for the file envutils-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: envutils-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 3.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.9.1

File hashes

Hashes for envutils-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 daa177836071d0dee8dece8ff7bd9b1a4b7dd59de16d855dc9dc34e61a109fb7
MD5 836510ddac2d70a78fb643978042a587
BLAKE2b-256 ebbc7ef9e595f5a06aba2fabcb357f96493a296ef848f5c69fdee58609874faa

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