使用yaml文件轻松配置
EasyCo的Python项目详细描述
易科
使用yaml文件轻松配置
目标
easy co的目标是为python程序提供使用yaml文件的coNiguration的easy方法。 它可以根据提供的默认值自动创建默认配置,并验证提供的数据。
文档
The documentation can be found at here
示例
fromEasyCoimportConfigFile,ConfigContainerclassMyContainer(ConfigContainer):SubValueA:intSubValueB:int=7classMyConfigFile(ConfigFile):ConfValueA:int=5ConfValueB:float=5.5sub_values=MyContainer()cfg=MyConfigFile('test')cfg.load()