Live data from Hacker News

Extracting Objects Recursively with Jq

til.simonwillison.net

1–10 of 76 posts

Re: Extracting Objects Recursively with Jq

#4
JQ is often frustrating when you want to do something non-trivial but you can't figure out how and the documentation is of little help.

I think JQ could really benefit from having a classic programming language style "book", like "The AWK Programming Language". JQ is fundamentally a functional programming language with semantics that are not obvious reading its current docs.

Re: Extracting Objects Recursively with Jq

#5
jq is nice, but the moment i need anything more complex than "pull this attribute out of bunch of objects" i vastly prefer spinning up an actual language runtime. or use a tool built around a language (e.g. https://github.com/borkdude/jet) rather than a language built around a tool.

Re: Extracting Objects Recursively with Jq

#7
post #3

jq is a fantastic tool for exploring data and doing simple transformations. I often wish it could consume/write data in other formats.

In python-land, I like to use glom[1], which is basically jq but operating on arbitrary python data structures. I believe there are bindings for jq in python in other languages, which would allow operating on data structures, but I imagine they are just spawning jq as a subprocess, since it doesn't seem like jq has a public C api.

[1] https://glom.readthedocs.io/en/latest/index.html

Re: Extracting Objects Recursively with Jq

#8
post #4

JQ is often frustrating when you want to do something non-trivial but you can't figure out how and the documentation is of little help. I think JQ could really benefit from having a classic programming language style "book", like "The AWK Programming Language". JQ is fundamentally a functional programming language with semantics that are not obvious reading its current docs.

I've also found the documentation tough to use when I need to jump back in and answer something like "how do I _____?" It feels like one of those sets of docs that's better approached by just reading the whole damn thing, working through some examples, etc. Studying the docs as opposed to referring to them.
Post reply on HN