python prettify terminal json only for json objects code example
Example 1: pretty json python
print(json.dumps(dict, indent=4))
Example 2: print json pretty linux
echo '{"foo": "lorem", "bar": "ipsum"}' | python -m json.tool
print(json.dumps(dict, indent=4))
echo '{"foo": "lorem", "bar": "ipsum"}' | python -m json.tool