14 ms·
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 dif
by aasasd 6y ago
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/fiatjaf/awesome-jq
https://github.com/TomConlin/json2xpath https://github.com/TomConlin/json2xpath
https://github.com/antonmedv/fx https://github.com/antonmedv/fx
https://github.com/fiatjaf/jiq https://github.com/fiatjaf/jiq
https://github.com/simeji/jid https://github.com/simeji/jid
https://github.com/jmespath/jp https://github.com/jmespath/jp
https://github.com/cube2222/jql https://github.com/cube2222/jql
https://jsonnet.org https://jsonnet.org
https://github.com/borkdude/jet https://github.com/borkdude/jet
https://github.com/jzelinskie/faq https://github.com/jzelinskie/faq
https://github.com/dflemstr/rq https://github.com/dflemstr/rq
Personally I think that next time I might just fire up Hy and use its functional capabilities.
- vips7L 6y agoDon't forget powershell's Convert-FromJson :) https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/convertfrom-json?view=powershell-7 https://docs.microsoft.com/en-us/powershell/module/microsoft...
- melbourne_mat 6y agoThat is so not jq! I've really been pining for jq on my current Windows project :-(
- vips7L 6y agoWhat do you feel is missing?
- mkesper 6y agoDoes it still convert only two levels by default?
- cristoperb 6y agoMy go-to for simple queries is https://github.com/tidwall/jj https://github.com/tidwall/jj It is not nearly as expressive as jq, but it is faster for my use cases (written in golang).
- jberryman 6y agoSorry, what is "Hy"?
- madmax108 6y agohttps://github.com/hylang/hy https://github.com/hylang/hy
- aasasd 6y agoA lightweight Lisp on top of Python. Personally I'd prefer Fennel, which is on Lua and thus a whole lot faster, especially in regard to the startup time—but as I noted in a thread on Fennel, Lua's omission of a proper ‘null’ makes it awkward to handle exchange and transformations of data from third parties. And, since I'm likely to fiddle with the queries for some time, startup delay is less important here.
- sansblob 6y agoLate to the party but Benthos has its own language aimed at larger mappings: https://www.benthos.dev/docs/guides/bloblang/about https://www.benthos.dev/docs/guides/bloblang/about
- retzkek 6y agoBabashka is another Hy-like alternative, but based on Clojure, and recently discussed on HN: https://github.com/borkdude/babashka https://github.com/borkdude/babashka https://news.ycombinator.com/item?id=24353476 https://news.ycombinator.com/item?id=24353476 Aside: another nice tool I recently discovered for working with JSON and YML, doing conversion and diffs (especially helpful for generated files): https://github.com/homeport/dyff https://github.com/homeport/dyff
- jdc 6y agoalso the interactive https://github.com/jmespath/jmespath.terminal https://github.com/jmespath/jmespath.terminal
- xonix 6y agoMy humble attempt https://github.com/jsqry/jsqry-cli2 https://github.com/jsqry/jsqry-cli2
- topher200 6y agoMy personal favorite solves the same problem but attacks it differently. > Make JSON greppable! > gron[1] transforms JSON into discrete assignments to make it easier to grep for what you want and see the absolute 'path' to it. It eases the exploration of APIs that return large blobs of JSON but have terrible documentation. ▶ gron "https://api.github.com/repos/tomnomnom/gron/commits?per_page=1" | fgrep "commit.author" json[0].commit.author = {}; json[0].commit.author.date = "2016-07-02T10:51:21Z"; json[0].commit.author.email = "mail@tomnomnom.com"; json[0].commit.author.name = "Tom Hudson"; [1] https://github.com/tomnomnom/gron https://github.com/tomnomnom/gron
- sitkack 6y agoGron and Jq are like peanut butter and jelly. Also gron has `gron -u` (ungron) to turn the pivot back into json.
- davesnx 6y agoThanks, next time if you paste the list somewhere else you can add query-json :P