3 ms·
I dump my JSON as YAML. Even if you are not using YAML for saving data (and I don't -- in Python at least PyYAML is orders of magnitudes slower than the built-i
by Erwin 13y ago
I dump my JSON as YAML. Even if you are not using YAML for saving data (and I don't -- in Python at least PyYAML is orders of magnitudes slower than the built-in JSON), it is nicer to read.
- kbenson 13y agoYAML was my first thought as well. Why not a library that converts back and forth and displayed the YAML in a pre tag or textarea? Then you could edit the YAML and after converting back still have valid JSON. YAML is a superset of JSON, but as long as the YAML used to convert to JSON started as JSON, there shouldn't be a problem.
- meowface 13y agoI use YAML for configs, as an option for API endpoints, and sometimes for debugging. Anything else that's computer-to-computer is JSON.
- krapp 13y agoI still like INI for configs. It's extremely simple and hard to mess up, and I think it's more readable than JSON.
- meowface 13y agoI use INI for configs most of the time, too, but if I ever need multiple-nesting or lists, I don't really have any choice but YAML. It's not common that I need that, but it can be useful for really big applications. I always try to use the right tool for the job.
- kanzure 13y agopyyaml provides the option of using the cyaml loader, but I dunno about the dumper.. if you're experiencing delays with reading, try setting Loader=cyaml or whatever.