Utilities for creating a 12 factor application, at present it allows you to parse the processes environment variables into a configuration dictionary.
For more information check the Documentation.
Install using poetry
poetry add twelvefactor
Install using pipenv
pip install twelvefactor
Install using pip
pip install twelvefactor
import flask
import twelvefactor
SCHEMA = {
'DEBUG': {
'type': bool,
'default': False,
},
'SECRET_KEY': str,
}
app = flask.Flask()
app.config.update(twelvefactor.config(SCHEMA))
# settings.py
import dj_database_url
import twelvefactor
SCHEMA = {
"DEBUG": {"type": bool, "default": False},
"SECRET_KEY": str,
"DATABASES": {
"key": "DATABASE_URL",
"default": "sqlite:///",
"mapper": lambda v: {"default": dj_database_url.parse(v)},
},
}
globals().update(twelvefactor.config(SCHEMA))
To install from source:
pip install poetry
git clone git://github.com/artisanofcode/python-twelvefactor.git
cd python-twelvefactor
poetry develop
Update CHANGES
and then run the following
poetry version patch
git commit -am 'bumped the version'
git tag v${VERSION}
poetry version prerelease
git commit -am 'prerelease version'
git push --tags
See CHANGES
This project is licensed under the MIT licence.
This project uses Semantic Versioning.