JQ syntax feels too unusual, doesn't resemble known code, gives me the feeling of looking into cryptic Perl or regex, could never remember the simplest things.<p>For example how would you take key k1 from a list of dicts [{k1: v1, k2: v2}, {k1: v3}]?
There’s also jp, which interprets JMESPath: <a href="https://github.com/jmespath/jp" rel="nofollow">https://github.com/jmespath/jp</a><p>This one has the advantage of being natively understood by aws-cli, meaning you can pass a JMESPath to an AWS call and only receive the filtered / transformed result back.
For those who are comfortable with python, I created Jello[0], which works like jq but uses python syntax.<p>I also created Jellex[1], which is a TUI built on Jello to assist with building the python queries.<p>Jello gives you the power of python but without all of the boilerplate, so it’s nicer to use in Bash scripts.<p>[0] <a href="https://github.com/kellyjonbrazil/jello" rel="nofollow">https://github.com/kellyjonbrazil/jello</a><p>[1] <a href="https://github.com/kellyjonbrazil/jellex" rel="nofollow">https://github.com/kellyjonbrazil/jellex</a>
Apparently, the author wrote this tool because jid was struggling with a 7MB JSON file.<p>See <a href="https://github.com/simeji/jid/issues/66#issuecomment-443671843" rel="nofollow">https://github.com/simeji/jid/issues/66#issuecomment-4436718...</a>
If you want to use jq but with Python syntax, I wrote pq:<p><a href="https://github.com/dvolk/pq" rel="nofollow">https://github.com/dvolk/pq</a>
That's pretty cool. Would be nice if there was an option to put the currently used filter/query into the shell history or the clipboard. So that you could experiment to find the right one, then back out and use it in a pipeline.
gron [0] is another interesting JSON processor that follows UNIX philosophy:<p>[0] <a href="https://github.com/tomnomnom/gron" rel="nofollow">https://github.com/tomnomnom/gron</a><p>"Make JSON greppable!"<p>"gron transforms JSON into discrete assignments to make it easier to grep for what you want and see the absolute 'path' to it."
I also like <a href="https://github.com/dflemstr/rq" rel="nofollow">https://github.com/dflemstr/rq</a> because it supports a few more formats (protobufs for example)
If you're into the SQL side (compared to jq's custom query language) of querying arbitrary files I've got a comparison of some major tools here too.<p><a href="https://github.com/multiprocessio/datastation/tree/main/runner/cmd/dsq#comparisons" rel="nofollow">https://github.com/multiprocessio/datastation/tree/main/runn...</a>
It would be a good idea if this was added to one of the existing[1] comparison tools for similar tools, there's already a lot of them out there.<p>1: <a href="https://cburgmer.github.io/json-path-comparison/" rel="nofollow">https://cburgmer.github.io/json-path-comparison/</a>
Another alternative is the oj app (ojg/cmd/oj) which is part of <a href="https://github.com/ohler55/ojg" rel="nofollow">https://github.com/ohler55/ojg</a>. It relies on JSONPath for extraction and manipulation of JSON.
Since nobody else mentioned it, there's also jiq, which uses jq under the hood.<p><a href="https://github.com/fiatjaf/jiq" rel="nofollow">https://github.com/fiatjaf/jiq</a>
<a href="https://github.com/akavel/up" rel="nofollow">https://github.com/akavel/up</a> is another tool that can be used to make most of commands interactive