I have an application where we are using configuration framework, based on *.conf files. Each such file represents some layer with configurations which can be overridden or merged with next layer. Also there is an ability to use references to some configuration definition from current definition, ability to build custom configurations based on some configuration template definition...
So actually there is an hierarchy of layers with configurations.
I am wondering if there is a mature enough YAML framework which could give above mentioned abilities? Please advise.
I did implement a similar configuration system for an application.
YAML itself only loads a stream into a native data structure. You need to think about how you define this data structure. There are several approaches:
dict
, list
and atomic values (string, int, …). This has the benefit that it is faily easy to merge the content of different files after loading.If you are searching for something that already implements most of what you want to do, I don't think you'll find anything. The problem with configurations is that they often are tightly bound to the application both in what they contain and in the way they ought to be processed. YAML is one of several common denominators for configuration files which is why it is often used for them, but more sophisticated features tend to depend so much on your specific requirements that it often does not make sense to release them as standalone frameworks.