Skip to main content

A tool for configuring your application via environment variables

Project description

env-config

https://img.shields.io/pypi/v/env_config.svg https://img.shields.io/travis/timmartin19/env_config.svg Documentation Status Updates

A tool for configuring your application via environment variables

Features

Gets configuration from environment variables that start with app_name optionally allowing you to load the environment variables as json

Example with load_as_json=True

from env_config import get_envvar_configuration

# Assuming that there are the following environment variables
# MYAPP_BOOL=false
# MYAPP_DICT={"some_key": "some_value"}
# MYAPP_STRING=blahblahblah
# NOTMYAPP_VARIABLE=this wont be recognized

config = get_envvar_configuration('myapp')
print(config)

# prints out {'BOOL': False, 'DICT': {'some_key': 'some_value'}, 'STRING': 'blahblahblah'}

Example with load_as_json=False

config = get_envvar_configuration('myapp', load_as_json=False)
print(config)

# prints out {'BOOL': 'false', 'DICT': '{"some_key": "some_value"}', 'STRING': 'blahblahblah'}

Credits

This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.

History

0.1.0 (2016-07-11)

  • First release on PyPI.

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

py-env-config-0.1.2.tar.gz (12.2 kB view hashes)

Uploaded source

Built Distribution

py_env_config-0.1.2-py2.py3-none-any.whl (4.8 kB view hashes)

Uploaded py2 py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page