ipython/ipython — pull request #4265 by Carreau (2013-09-24 06:59:19+00:00)
Title: [Draft/Playground] Json configuration file

Mainly playing around with json as format for configuration in IPython.

Even if it's pretty easy to have it "just work", I'm looking at wether it would be possible to still have more dynamic configuration system and more especially thinking of the following :

- [ ] how do you produce json file and differentiate default value from user-modified value ?
- [ ] is there a way to express that you want to "extend" (append/prepend) a list in a previous conf file
- [ ] how to store comments in json files.
- [ ] embed version/type of json configuration files.

right now I'm mostly working in a [notebook](https://raw.github.com/Carreau/ipython/jsoncf/Jsconf.ipynb) to do that,
and I have the "basic" key/value json woking as welll as something along thoses lines :

```
config = {
"Exporters":{
"config" : {
'transformers' : {'extend':["Foo.bar"],
'prepend' :["I am first"]
},
'template_file' : {'set':'new.tpl'},
'template_ext' : {'set':'tpl -- I exit only in the new'},
'dicattribute' : {'merge':{'anotherkey':False}}
}
}
}
```

little more verbose that default config, but basically all odd depth of json can contains predefined keys that tell the configuration reader wether the rest of the subtree should be merged with current subconfig/replace current subconfig/ be prepended appended to current subconfig.

This way one could also add keys like 'comment' or 'default' that are ignored and can be easily updated through upgrade process.

I haven't looked yet at top level key that may allow to define version number and/or inheriting from another config.