- https://stedolan.github.io/jq/
- https://stedolan.github.io/jq/tutorial/
- https://stedolan.github.io/jq/manual/
- https://github.com/stedolan/jq
- https://github.com/stedolan/jq/wiki
- https://github.com/stedolan/jq/wiki/Cookbook
- https://stackoverflow.com/questions/tagged/jq
- http://shop.oreilly.com/product/0636920032823.do – o’Reilly “Data Science at the Command Line” – has some examples making use of jq
- https://library.oreilly.com/book/0636920032823/data-science-at-the-command-line/84.xhtml?ref=toc#_jq – behind a paywall
- available as source (portable C) and as executables for various Intel-based platforms, i.e. some Linux distributions, Mac OS X, Windows incl. Cygwin
- https://cygwin.com/packages/x86_64/jq/
- https://www.safaribooksonline.com/library/view/json-at-work/9781491982389/ch06.html#json_search : …,
jq
,jqPlay
,jq-tutorial
, …
“jq” (presumably) stands for “JSON query processor”.
jq helps writing shell scripts processing JSON responses from e.g. RESTful application APIs like Jenkins, Atlassian JIRA, Atlassian Confluence, … – code making use of powerful means like XPath (…) or jq is supposedly far more readable than Python / Perl / … scripts slurping the JSON and processing it (w/o jq resp. XPath) – but there are also Python resp. Perl bindings for jq.
Hope and fear
A couple of weeks ago I had written a shell script querying a Jenkins server’s REST API “à la XML”. Now it looks a little straighter to query the API “à la JSON” and employ jq. But the critical question is, whether the (industrial) customer (I wrote the Jenkins utility for) will like the dependency on a utility like jq. My Jenkins utility might have to serve for quite a couple of years – but who can predict the future and availability of jq?
Update 2016-02-23: Meanwhile I built a shell script with a couple of simple jq queries accessing Jenkins CI. Looks rather impressive to me.
If you do XPath queries from shell scripts, you always have the option to rewrite the shell script as Python or Perl script. But what about JSON queries (…) in Python or Perl?
- https://pypi.python.org/pypi/jq
- https://github.com/spiritloose/JQ — “Perl binding for jq”
By default, jq pretty-prints JSON output.
$ jq . < … > …