Can someone suggest how I can beautify JSON in Python or through the command line?
The only online based JSON beautifier which could do it was: http://jsonviewer.stack.h
From the command-line:
echo '{"one":1,"two":2}' | python -mjson.tool
which outputs:
{ "one": 1, "two": 2 }
Programmtically, the Python manual describes pretty-printing JSON:
>>> import json >>> print json.dumps({'4': 5, '6': 7}, sort_keys=True, indent=4) { "4": 5, "6": 7 }