define and set application properties using a file and enviornment variables
This module offers the ability to define and set application properties using both a property file and enviornment variables. It was originally intended to ease application configuration for apps running in Docker containers.
The property file can be formatted in JSON or YAML. A "properties" object is defined in the file. Each entry should be an object with at least a "type" field. The supported types are defined in EnvProps.supported_datatypes. The key of the object will be name of the property. This is also the name of the enviornment variable for which the parser will check. Optionally, a "default" field can be defined for each property which will specify a value to use if one is not provided via the enviornment. If no default is provided, EnvProps will throw an exception if no value is found in the enviornment.
Using with Flask/Quart
from envprops import EnvProps from flask import Flask app = Flask(__name__) env = EnvProps('properties.json') app.config.update(env.asdict())
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size pyenvprops-0.3.2-py3-none-any.whl (4.0 kB)||File type Wheel||Python version py3||Upload date||Hashes View|
|Filename, size pyenvprops-0.3.2.tar.gz (3.3 kB)||File type Source||Python version None||Upload date||Hashes View|
Hashes for pyenvprops-0.3.2-py3-none-any.whl