Skip to main content

Takumi service framework configuration module

Project description

https://travis-ci.org/elemepi/takumi-config.svg?branch=master

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)

Uploaded Source

Built Distribution

takumi_config-0.1.1-py2.py3-none-any.whl (8.5 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page