pretty-json-poster.jpg

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.

pretty-json-screenshot.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

high-five.gif

🙏