2 ms·
YAML isnt my idea of clarity but thats fine. I tend to go with using a python script to generate a json file. This supports comments, if-else decision making, m
by rs23296008n1 7y ago
YAML isnt my idea of clarity but thats fine. I tend to go with using a python script to generate a json file. This supports comments, if-else decision making, modules and all sorts of other smarts. Tell users not to edit the resulting json file - its readonly.
Python gives you all the power of scripting including validation and json gives you the easily readable format for both humans and machines. Great for knowing exactly what the settings evaluated as.
And when you don't need the power of full expressive python script, you can just json.dump() a python dictionary and be done with it.
I've also used sqlite as a config file format and that is very polite and easily read from anything I use.