5 ms·
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
by msluyter 4y ago
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 https://github.com/tomnomnom/gron
- zimpenfish 4y agoUsed 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.
- radicality 4y agoFor 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/ https://glom.readthedocs.io/en/latest/
- RulerOf 4y agoGron 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.