The Folklore service framework configuration module
Project description
The Folklore framework configuration manager.
Configs are in yaml format stored in app.yaml by default. An environment vairable FOLKLORE_APP_CONFIG_PATH can be used to change the path of the yaml file.
To set current running environment of the app use environment vairable FOLKLORE_ENV. The default env is dev.
Usage
For the given config files:
# app.yaml
app_name: echo
app: echo:service
settings: settings
# settings.py
DB_DSN = 'psycopg2+postgresql://root:123@localhost:5432/dev'
>>> # With this environment vairable set:
>>> # FOLKLORE_ENV=prod
>>>
>>> from folklore_config import config
>>> print(config.env)
'prod'
>>> print(config.app_name)
'echo'
>>> config.settings.update({'TEST': True, 'HELLO': 'world'})
>>> print(config.settings['TEST'])
True
>>> print(config.settings['DB_DSN'])
'psycopg2+postgresql://root:123@localhost:5432/dev'
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
File details
Details for the file folklore_config-0.2.0-py2.py3-none-any.whl
.
File metadata
- Download URL: folklore_config-0.2.0-py2.py3-none-any.whl
- Upload date:
- Size: 5.6 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 430e93d03d7fb6ef2985d45ac4b3c3e0daf78525a39aad7fede2ac0cd07ef8ae |
|
MD5 | 717ba42c7ee744f03b119eef48d9e908 |
|
BLAKE2b-256 | 6efbecb5ea8f2c7564503cff0e3c7fd111eb10603d72a524a3650cda09c4c3bf |