adblair / configloader

Python dictionary that supports common app configuration-loading scenarios

Home Page:https://configloader.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ConfigLoader

https://travis-ci.org/adblair/configloader.svg?branch=master https://coveralls.io/repos/adblair/configloader/badge.svg?branch=master&service=github

ConfigLoader is a Python dictionary subclass that provides convenience methods for common app configuration-loading scenarios, inspired by flask.Config.

Features

Easily load config settings from:

  • Python modules, classes or objects
  • JSON files
  • YAML files
  • Environment variables

Supports Python 2.7+ and 3.4+.

Installation

Install ConfigLoader from PyPI using pip:

pip install configloader[all]

The [all] indicates that all optional dependencies (AttrDict and PyYAML) should be installed.

Example usage

>>> from configloader import ConfigLoader
>>> config = ConfigLoader()
>>> config.update_from_object('my_app.settings')
>>> config.update_from_yaml_env('YAML_SETTINGS_PATH')

Documentation

https://configloader.readthedocs.org/en/stable/

About

Python dictionary that supports common app configuration-loading scenarios

https://configloader.readthedocs.io

License:MIT License


Languages

Language:Python 87.4%Language:Makefile 12.6%