3 ms·
IMHO nothing beats jq[1]. There's Pyjq[2] for Python. [1] https://stedolan.github.io/jq/ https://stedolan.github.io/jq/ [2] https://github.com/doloopwhile/pyjq
by inshadows 7y ago
IMHO nothing beats jq[1]. There's Pyjq[2] for Python.
[1] https://stedolan.github.io/jq/ https://stedolan.github.io/jq/
[2] https://github.com/doloopwhile/pyjq https://github.com/doloopwhile/pyjq
- bachmeier 7y agoI personally find jq to be extremely complicated once you move beyond simple queries.
- nexuist 7y agoAfter having used jq for some heavy data processing (building an entire Markdown document from a huge slab of JSON with no external tools), I am inclined to agree. However, I think this may be indicative of the task you are trying to complete rather than the tool itself. At a certain level of complexity your resulting code will just look bad regardless of which language you use. One thing jq does to make this easier is providing the pipe operator, so you can break a complex task into stages: A | B | (C .... | C.5) | D | E...
- benibela 7y agoYou could try my Xidel, based on XPath and JSONiq ( http://www.videlibri.de/xidel.html http://www.videlibri.de/xidel.html ). It is more verbose for simple queries, but with named variables and functions, larger queries do not become complicated
- inshadows 7y agoXidel is my immediate pick for querying HTML. I use it in several scripts. Thanks! I still prefer jq for JSON processing though. I'm hooked to pipelines. EDIT: The great power of jq is in transforming documents, not querying.
- ecnahc515 7y agoYou can use a separate file to define your jq program, and even define functions to make it more readable.
- kmelve 7y agoYou should try out GROQ (https://groq.dev https://groq.dev) then!