Takumi service framework configuration module
Project description
Takumi framework configuration manager. All configs are yaml files. There two different kinds of configs.
Env configs are independent to applications. Default path /etc/takumi/env.yaml. All fields are optional by default.
Application related configs. Default path $APP_ROOT/app.yaml. Required fields: app_name.
All configs can be accessed through the object config from takumit_config module. Env configs are stored in config.env.
Usage
For the given config files:
# /etc/takumi/env.yaml env: prod # app.yaml name: echo app: echo:service settings: settings # settings.py DB_DSN = 'psycopg2+postgresql://root:123@localhost:5432/dev'
>>> from takumi_config import config
>>> print(config.env.name)
'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
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
takumi_config-0.1.0.tar.gz
(4.1 kB
view hashes)
Built Distribution
Close
Hashes for takumi_config-0.1.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b7689e45bce0e5be8d879ea15ad04387fccd7a4edda87dcc4abe8fa839a51038 |
|
MD5 | 8bb53e21439d67519a476e366315e9cd |
|
BLAKE2b-256 | cc97869b5b0e3d1706bce0d00c80204979f919460311acff6a65deec53677406 |