Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Whenever jq comes up I feel obligated to mention 'gron'[1]. If all you're doing is trying to grep some deeply nested field, it's way easier with gron, IMHO.

[1] https://github.com/tomnomnom/gron



Gron and jq are complementary tools IMO. I frequently use gron to trim down large json files such that I can determine what my ultimate jq query is going to look like.


For a moment I thought that this is `glom`, which is also a tool I can recommend if you need to be doing any json processing in python (comes with a cli too). It does have a relatively steep learning curve for the advanced features, but does allow you to do interesting things like concisely write recursive parsers in the mini-dsl Glom provides.

https://glom.readthedocs.io/en/latest/


Used it only this morning to find out if/where the JSON for a tweet mentioned the verification status of the poster and/or retweetee[1]. Quick and easy to dump it through `gron | grep verif` to find out the paths.

[1] "the person who was retweeted" in lieu of a better word.




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

Search: