What does HackerNews think of rq?

Record Query - A tool for doing record analysis and transformation

Language: Rust

#4 in Node.js
#22 in JavaScript
#3 in JSON
#21 in Rust
I'm surprised no one mentioned rq [1] yet. It's come up before in older HN threads [2] whenever the discussion on jq comes up...

[1] https://github.com/dflemstr/rq [2] https://news.ycombinator.com/item?id=13090604

I also like https://github.com/dflemstr/rq because it supports a few more formats (protobufs for example)
Stepping just a little beyond regular ‘loop and filter’ is already difficult without consulting the manual each time — being exacerbated by the impossibility of finding those things in the manual without skimming through most of it. Making an ‘if’ for variations in the input structure is easily a twenty-minute job. Outside of the basic features, Jq's syntax is increasingly arcane and unintuitive—maybe those working with it daily do remember the ‘advanced’ stuff, but I don't.

I actually collected a sizable list of alternatives to Jq:

https://github.com/TomConlin/json2xpath

https://github.com/antonmedv/fx

https://github.com/simeji/jid

https://github.com/jmespath/jp

https://jsonnet.org

https://github.com/borkdude/jet

https://github.com/jzelinskie/faq

https://github.com/dflemstr/rq

https://github.com/mgdm/htmlq

And there's someone else's list of stuff around Jq: https://github.com/fiatjaf/awesome-jq

However, personally I think that next time I might instead fire up Hy, and use the regular syntax with the functional approach for any convoluted processing I come up with. Last time I mentioned this, another HNer made a Jq-like tool with Lisp-like syntax: https://github.com/cube2222/jql (from https://news.ycombinator.com/item?id=21981158).

There's also rq (record query)[1] that also supports CSV and JSON but not TSV though. It's written in Rust.

[1] https://github.com/dflemstr/rq

For everyone pining for a Jq with a different syntax: I have a bunch of links to alternatives collected, you might want to try some of them (some may be for different things than JSON):

https://github.com/fiatjaf/awesome-jq

https://github.com/TomConlin/json2xpath

https://github.com/antonmedv/fx

https://github.com/fiatjaf/jiq

https://github.com/simeji/jid

https://github.com/jmespath/jp

https://github.com/cube2222/jql

https://jsonnet.org

https://github.com/borkdude/jet

https://github.com/jzelinskie/faq

https://github.com/dflemstr/rq

Personally I think that next time I might just fire up Hy and use its functional capabilities.

There is more universal alternative to jq that supports also protobuf, msgpack, cbor, etc - rq[1].

[1] https://github.com/dflemstr/rq

This is a really slick little utility! I'll definitely be adding it to my data munging grab bag.

For those that deal with this sort of thing often, here are some similarly useful tools:

Really useful for generating table definitions and/or importing data from a csv to a variety of databases (bunch of other useful utilities in the repo as well): https://csvkit.readthedocs.io/en/latest/scripts/csvsql.html

Similar to cq for querying a CSV file directly: http://harelba.github.io/q/

Not used often, but really handy when you come across a csv file it's designed for: http://colin.maudry.com/csvtool-manual-page/

Diff csv files: http://paulfitz.github.io/daff/

Can convert flatfiles between a bunch of different formats. Useful blunt tool to get things to and from csv files (among others): https://github.com/dflemstr/rq

And for searching JSON: jq: https://stedolan.github.io/jq/ gron: https://github.com/tomnomnom/gron

Or use in2csv from csvkit or rq to get the JSON over to CSV and go from there.

Record-query [1] embeds v8 for its query language, which seems to add a significant amount of heft. I know that couchdb uses js for querying as well. It seems like this could be another option for something like that.

[1] https://github.com/dflemstr/rq

Written in Rust:

- rq: A tool for doing record analysis and transformation (replacement for jq, supports yaml, json, avro, protocol buffers, etc.) https://github.com/dflemstr/rq

An alternative that completely replaced jq for me: rq https://github.com/dflemstr/rq

Not limited to JSON, and super fast.