Skip to main content

Python library for loading app configurations from files and/or namespaced environment variables

Project description

Build Status Coverage Status

CLIMATECONTROL

Python library for loading app configurations from files and/or namespaced environment variables.

Install

pip install climatecontrol

Usage

Set some environment variables in your shell

MY_APP_SECTION1_SUBSECTION1=test1
MY_APP_SECTION2_SUBSECTION2=test2
MY_APP_SECTION2_SUBSECTION3=test3
MY_APP_SECTION3=not_captured

Then use them in your python modules:

from climatecontrol.settings_parser import Settings
settings_map = Settings(env_prefix='MY_APP', filters={'section1': 'subsection1', 'section2': None})
print(dict(settings_map))

The output should look something like this:

{'section1': {'subsection1': 'test1'}, 'section2': {'subsection2': 'test2', 'subsection3': 'test3'}}

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

climatecontrol-0.1.1.tar.gz (5.7 kB view hashes)

Uploaded Source

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