Pretty-Printing JSON with Python's JSON Tool
Join the DZone community and get the full member experience.Join For Free
today's quick tip is something that was widely retweeted after my "debugging http" talk at the ever-fabulous whiskyweb conference last weekend. when working with json on the commandline, here's a quick tip for showing the json in a nicer format:
curl http://api.joind.in | python -mjson.tool
you need python installed, but the json extension is probably included, and that's all you need for this tool. the result is something like:
you can also use this approach to present json data that has been captured to another file, for example, it's a handy trick that i use often when developing something with json as a data format.
Published at DZone with permission of Lorna Mitchell, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.