Skip to content

wikimedia/yamlconf

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Yaml Configuration

This library provides a means to read yaml configuration files and propagate default values in reasonable ways. Nothing complicated.

  • Installation: pip install yamlconfig
Example:
>>> import yamlconf
>>>
>>> doc = yamlconf.loads("""
... test: demo_test
...
... tests:
...     defaults:
...         foo: 5
...     demo_test:
...         bar: 6
... """)
>>>
>>> doc['tests'][doc['test']]['foo']
5
>>> doc['tests'][doc['test']]['bar']
6
Functions:
  • load(file-like) : Returns a dict with defaults propagated
  • loads(string) : Returns a dict with defaults propagated
  • load_module(class-path) : Imports and returns

About

This library provides a means to read yaml configuration files and propagate default values in reasonable ways. Nothing complicated.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 100.0%