Skip to main content

Read settings from environment variables.

Project description

Easily read settings from environment variables. Reading settings from environment variables allows complete isolation between application and configuration data.

Read the Twelve-Factor App’s relevant section for more rationale behind this approach.


The following example will read the environment variables into configuration values host, port, and debug, cast to the expected type:

from envsettings import SettingsReader

r = SettingsReader(
    host=("HOST", "host", str),
    port=("PORT", "port", int),
    debug=("DEBUG", "debug", bool),

if r.debug:
   print("Running in debug mode"), r.port, debug=r.debug)

Boolean values can be either true, yes, or on and are case insensitive.


Any feedback is welcome, and please report any bugs you encounter on the project’s issue tracker.

Patches or merge requests are welcome.


envsettings is licensed under the ISC licence (functionally equivalent to the MIT licence). See for details.

Copyright (c) 2014-2015 Hugo Osvaldo Barrera <>

Project details

Release history Release notifications

This version
History Node


History Node


History Node


History Node


Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
envsettings-2.1.0-py3-none-any.whl (3.9 kB) Copy SHA256 hash SHA256 Wheel py3 Jan 21, 2017
envsettings-2.1.0.tar.gz (3.4 kB) Copy SHA256 hash SHA256 Source None Jan 21, 2017

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page