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.1.tar.gz
(4.6 kB
view hashes)
Built Distribution
Close
Hashes for takumi_config-0.1.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a17775b9181cb6d043e19049456218468da43382ec34eaa2689573f4562271b8 |
|
MD5 | 5d5150d8713906a38b1c2720dfee8f1b |
|
BLAKE2b-256 | 9aa041014f8d158298a4bae42824689c717081ea8c380b59afb18a1732901172 |