验证配置文件内容的配置读取器(yaml)。
impulsare-config的Python项目详细描述
概述
配置读取器,用于验证yaml配置文件并在需要时添加默认值。
不会验证额外的值,任何组件/库都定义了自己的配置参数 在一个配置文件中不阻止其他配置文件执行相同操作。
有关示例,请参见测试/static/。
安装/使用
要安装,请使用pip:
$ pip install --upgrade impulsare-config
示例
fromimpulsare_configimportReader# Main Config Fileconfig_file='config/app.yml'# File with validation rules based on JSON Schemaspecs_file='config/specs.yml'# Default valuesdefault_file='config/default.yml'config=Reader().parse(config_file,specs_file,default_file)
开发和测试
$ pip install -r requirements.txt
$ pip install -r requirements-dev.txt
$ py.test --cov-report html --cov=impulsare_config tests/