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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 2 Python 3

File details

Details for the file py-env-config-0.1.2.tar.gz.

File metadata

File hashes

Hashes for py-env-config-0.1.2.tar.gz
Algorithm Hash digest
SHA256 8001c4774cac6bc623602bec1316bc74aacfc4e963df26acc406fe96caaad750
MD5 837034842b81a480652dc3a1a4639506
BLAKE2b-256 537a3724d2448dddd516016ce13649a8a4ade133b4791fc1371c2dcf95ff3104

See more details on using hashes here.

File details

Details for the file py_env_config-0.1.2-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for py_env_config-0.1.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 fec7f4e14cf570dde57d9eb74b6045698219870f1e20567e07a01a85c1f0d528
MD5 72f8c4520f7d097b87ec135e057a54fd
BLAKE2b-256 90ce1ef9f974510c7e833b182f12bdc2754bf08db593212ccf470f7927c9b98f

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