目录

cascade-config

Cascading Python configuration from the CLI and multiple config files.

cascade-config simplifies handling multiple configuration sources, such as config files, command line arguments, or even simple dictionaries. Configuration sources can be added one-by-one and will be parsed in hierarchical order, with each new source updating the existing configuration.

Installation

Install with pip

pip install cascade-config

Quickstart

Multiple configuration sources can be added to a cascade_config.CascadeConfig object. When parsed, each configuration will be added in hierarchical order and update the existing configuration. The result is a single dictionary containing the cascaded configuration.

from cascade_config import CascadeConfig

# Setup CascadeConfig instance with JSON schema for validation
cascade_conf = CascadeConfig(validation_schema="config_schema.json")

# Add default and user configurations in cascading order
cascade_conf.add_json("config_default.json")
cascade_conf.add_json("config_user.json")

# Parse the configuration files into a dictionary
config = cascade_conf.parse()

See Usage for more information and examples.

Contributing

Bugs, questions or suggestions? Feel free to post an issue in the issue tracker or to make a pull request! See Contributing for more info.

Changelog

See Changelog.

关于

用于管理和配置应用程序设置的软件

89.0 KB
邀请码
    Gitlink(确实开源)
  • 加入我们
  • 官网邮箱:gitlink@ccf.org.cn
  • QQ群
  • QQ群
  • 公众号
  • 公众号

版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9 京公网安备 11010802032778号