Skip to main content
https://api.travis-ci.org/dbader/envconfig.png https://coveralls.io/repos/dbader/envconfig/badge.png https://pypip.in/v/envconfig/badge.png

A module for reading configuration values from the OS environment variables.

Compared to using straight os.getenv() this module provides a view convenience functions, for example, for parsing booleans.

I was not happy with using straight os.getenv() because we’ve had a number of errors that were related to missing config values in .env files. This module should help with that by providing a clean way for accessing config variables.

Usage

$ pip install envconfig
import envconfig

boolopt = envconfig.bool("BOOL_OPTION")
intopt = envconfig.int("INTEGER_OPTION")
stropt = envconfig.int("STRING_OPTION")
listopt = envconfig.list("LIST_OPTION")
dictopt = envconfig.dict("DICT_OPTION")

Meta

Daniel Bader – @dbader_orgmail@dbader.org

Distributed under the MIT license. See LICENSE.txt for more information.

https://github.com/dbader/envconfig

History

0.2.0 (2021-07-23)

  • Add envconfig.dict()

0.1.0 (2013-05-27)

  • Initial release

Download files

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

Source Distribution

envconfig-0.2.0.tar.gz (4.5 kB view details)

Uploaded Source

File details

Details for the file envconfig-0.2.0.tar.gz.

File metadata

  • Download URL: envconfig-0.2.0.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.8.2

File hashes

Hashes for envconfig-0.2.0.tar.gz
Algorithm Hash digest
SHA256 fcf944ff195073004c33cc3e16e26d3ec49eebbd79b7c58df78950a1630fa337
MD5 afdefccaa4b0bf7dfd970bc8a577995e
BLAKE2b-256 ab2e2de77f84c6daa21838cad2ec2a88a35c19711ac78d2fd49c821cb4f8e694

See more details on using hashes here.

Supported by

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