Nick Coghlan <ncoghlan <at> gmail.com> writes:
On Fri, Jun 22, 2012 at 4:42 PM, Tarek Ziadé <tarek <at> ziade.org> wrote:
On 6/22/12 7:05 AM, Nick Coghlan wrote: I don't understand what's the problem is with ini-style files, as they are suitable for multi-line variables etc. (see zc.buildout)
yaml vs ini vs xxx seems to be an implementation detail, and my take on this is that we have ConfigParser in the stdlib
You can't do more than one layer of nested data structures cleanly with an ini-style solution, and some aspects of packaging are just crying out for metadata that nests more deeply than that. The setup.cfg format for specifying installation layouts doesn't even come *close* to being intuitively readable - using a format with better nesting support has some hope of fixing that, since filesystem layouts are naturally hierarchical.
A JSON based format would also be acceptable to me from a functional point of view, although in that case, asking people to edit it directly would be cruel - you would want to transform it to YAML in order to actually read it or write it.
The format-neutral alternative I used for logging configuration was a dictionary schema - JSON, YAML and Python code can all be mapped to that. Perhaps the relevant APIs can work at the dict layer. I agree that YAML is the human-friendliest "one obvious" format for review/edit, though. +1 to the overall approach suggested, it makes a lot of sense. Simple is better than complex, and all that :-) Regards, Vinay Sajip