ConfigAlchemy

https://img.shields.io/pypi/v/configalchemy.svg CI Test Status Documentation Status https://img.shields.io/pypi/pyversions/configalchemy.svg https://codecov.io/gh/GuangTianLi/configalchemy/branch/master/graph/badge.svg https://img.shields.io/badge/code%20style-black-000000.svg

中文

The Settings and Configuration on ideal practices for cloud-native app development and package building.

Installation

$ pipenv install configalchemy
✨🍰✨

Only Python 3.6+ is supported.

Example

from configalchemy import BaseConfig

class DefaultConfig(BaseConfig):
    NAME = "test"

config = DefaultConfig()
config.NAME
>>> 'test'

Features

  • Base on The Twelve-Factor App Configuration.

  • Configurable dynamic configurator

  • Configuration-Oriented Development

    • Define default config value and its type which is used in your project
    • Use class to support inheritance to explicitly define configurable config
  • Override config value from multiple source with priority supported

    • Callable function return value
    • File (default: json)
    • Environment Variables
  • Proper Typecast before overriding

  • Generic Config Type Support by custom typecast

  • Lazy and Proxy Object Support.

  • Extension

TODO

  • IOC - Injector, Singleton