Hacker News new | past | comments | ask | show | jobs | submit login

Or

    cat foo.json | python3 -m json.tool
Prettifying is also built in to python3 on any system.



Or

    jq  . foo.json


jq is freaking awesome! It can do amazing stuff, it's like awk for JSON on steroids. Highly recommend reading the documentation: https://stedolan.github.io/jq/manual/


useless use of cat:

python3 -m json.tool foo.json


Usually though what happens is this:

    :) cat foo.json
    [oh crap]
    :) cat foo.json | python -m foo.tool
For the 2nd command I'd hit "[up] | pyth[tab] -m json.tool"




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: