Pretty json output in terminal using pjson

I often print API responses in my terminal using the curl command, but that's usually not very readable. A while ago I came across a python package called pjson which formats json output.

By piping your commands with pjson you get nicely formatted & colored json output.

85fe9d08-f189-4b7d-a0e2-2aa83fb9bdab.jpg

Install

It's a zero config one command installation process using pip.

pip install pjson

Or using easy_install.

easy_install pjson

Usage

If you now pipe your curl commands with pjson you should see some nicely formatted json, very nice! Why don't you give it a try with the following command.

curl https://api.github.com/feeds | pjson

908f2980-51ed-45ce-9c4e-7d339b5fc74e.gif

šŸ™