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.

Configs are in yaml format stored in app.yaml by default. An environment vairable TAKUMI_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 TAKUMI_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:
>>> # TAKUMI_ENV=prod
>>>
>>> from takumi_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

This version
History Node

0.1.3

History Node

0.1.2

History Node

0.1.1

History Node

0.1.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
takumi_config-0.1.3-py2.py3-none-any.whl (6.0 kB) Copy SHA256 hash SHA256 Wheel py2.py3 Apr 5, 2017
takumi_config-0.1.3.tar.gz (3.4 kB) Copy SHA256 hash SHA256 Source None Apr 5, 2017

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page