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


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.3.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

takumi_config-0.1.3-py2.py3-none-any.whl (6.0 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file takumi_config-0.1.3.tar.gz.

File metadata

File hashes

Hashes for takumi_config-0.1.3.tar.gz
Algorithm Hash digest
SHA256 1e0477b8b308e596b6df7687e89516c43b6f2ffa82bd8bbbd353381878191b33
MD5 e05b200a654743734ae50a7d044b889b
BLAKE2b-256 a025b3f4aaeff74fa18d0f2b55dcbb995de25dc09d6821a442a19564f629765e

See more details on using hashes here.

File details

Details for the file takumi_config-0.1.3-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for takumi_config-0.1.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 909b1150e651830fc62cffffdf97112fb4afa431640664e3eea702bd89e0f240
MD5 33eceff6fb1678dcd07184c6a3935e17
BLAKE2b-256 43005a1c72bc81d12f5e528d380590ba842c8f790eff27125f8c2163729432ba

See more details on using hashes here.

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