by bash python 1 min read

Pretty printing json

Here is a really simple way to pretty print some unformatted json


$ echo '{"foo": "lorem", "bar": "ipsum"}' | python -mjson.tool
{
    "bar": "ipsum",
    "foo": "lorem"
}