Skip to main content

The Folklore service framework configuration module

Project description

https://travis-ci.org/maralla/folklore-config.svg?branch=master

The Folklore framework configuration manager.

Configs are in yaml format stored in app.yaml by default. An environment vairable FOLKLORE_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 FOLKLORE_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:
>>> # FOLKLORE_ENV=prod
>>>
>>> from folklore_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 Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

folklore_config-0.2.0-py2.py3-none-any.whl (5.6 kB view details)

Uploaded Python 2Python 3

File details

Details for the file folklore_config-0.2.0-py2.py3-none-any.whl.

File metadata

  • Download URL: folklore_config-0.2.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.7.4

File hashes

Hashes for folklore_config-0.2.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 430e93d03d7fb6ef2985d45ac4b3c3e0daf78525a39aad7fede2ac0cd07ef8ae
MD5 717ba42c7ee744f03b119eef48d9e908
BLAKE2b-256 6efbecb5ea8f2c7564503cff0e3c7fd111eb10603d72a524a3650cda09c4c3bf

See more details on using hashes here.

Supported by

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