I would like to virtualize configuration so my classes don't know anything about how setting arrive. Normally I pass classes a dictionary with everything needed to get up and running. This approach has been helpful in production and testing as the test cases aren't tied to specific data files and the code is unaware of the environment it is running in.
The problem arises when the configuration data gets more extensive; for instance the files grow large or information needs to be passed to subcomponents that also have complex configurations. In these cases a single configuration file no longer makes sense.
It would be nice to add directives to the config files that tell a preprocessor where to pull additional setting from. For instance the following json:
{
"a" : "plain old json string",
"b" : ${LoadFromJsonFile(<file path>)},
"c" : ${LoadCsvAsListOfDict(<file path>)}
{
Is there a library for this or is this something I should write on my own or is this idea problematic?
btw - I looked at the related stackexchange questions and didn't see anything similar and/or specific to python. There was one suggest to use XML with Ant but I would prefer to stick with a python environment.