Skip to main content

The Settings and Configuration on ideal practices for app development.

Project description

ConfigAlchemy

https://img.shields.io/pypi/v/configalchemy.svg https://img.shields.io/travis/GuangTianLi/configalchemy.svg 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 app development.

Installation

$ pipenv install configalchemy
✨🍰✨

Only Python 3.6+ is supported.

Example

from configalchemy import BaseConfig

class DefaultConfig(BaseConfig):
    TEST = "test"

config = DefaultConfig()
config.TEST # attribute style access
>>> 'test'
config['TEST'] # dict item style access
>>> 'test'
config.get('TEST') # dict get style access
>>> 'test'
config.get('HOST', 'local') # Providing defaults
>>> 'local'

Features

  • 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 (json)

    • Environment Variables

  • Proper Typecast before overriding

  • Generic Config Type Support by custom typecast

  • Extension

TODO

  • Add More Proper Log

History

0.2.* (2019-08)

  • Change global variable to weak reference

  • Remove Lock (Prepare to implement optimistic raw lock if necessary)

  • Improve Priority Data Structure

  • Improve Field Validation

  • Use OOP to define call function

  • Properer validation and typecast

  • Improve Type Annotations

  • Import JSON type

0.1.0 (2019-08-01)

  • Init Project.

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

configalchemy-0.2.7.tar.gz (17.9 kB view hashes)

Uploaded Source

Built Distribution

configalchemy-0.2.7-py2.py3-none-any.whl (11.0 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