
For pretty-printing a file consisting of a single large JSON entity, the practical limitation is RAM. You'd soon need to write a separate script-file, you could end up with maps whose keys are u"some-key" (python unicode), which makes selecting fields more difficult and doesn't really go in the direction of pretty-printing.Īnd you get colors as a bonus (and way easier extendability).Īddendum: There is some confusion in the comments about using jq to process large JSON files on the one hand, and having a very large jq program on the other. For simple pretty printing is ok, but if you want to manipulate the json it can become overcomplicated. (as already mentioned in the commentaries to the question, thanks to Petzke for the python3 suggestion).Īctually python is not my favourite tool as far as json processing on the command line is concerned. You can do this on the command line: python3 -m json.tool some.json
