jq playground
Reshaping JSON with jq | Programming Historian – this is where I learnt how to generate from a hierarchical json object. This is a real nice tutorial to learn about jq.
“A post announcing the 1.0 release of pq, my Rust command-line protobuf deserializer”
jq examples and cheatsheet on reddit.
See also: jo, a tool to write JSON in the shell. Example usage:
$ jo -p name=jo n=17 parser=false
{
"name": "jo",
"n": 17,
"parser": false
}
2020-06-01: https://github.com/kellyjonbrazil/jc This tool converts the output of popular command-line tools and file-types to JSON. This allows piping of output to tools like jq.
Example:
$ ls -l /usr/bin | jc --ls | jq '.[] | select(.size > 50000000)'
{
"filename": "docker",
"flags": "-rwxr-xr-x",
"links": 1,
"owner": "root",
"group": "root",
"size": 68677120,
"date": "Aug 14 19:41"
}
2020-06-01: https://github.com/kellyjonbrazil/jtbl – A simple cli tool to print JSON and JSON Lines data as a table in the terminal
Example:
$ cat cities.json | jtbl
LatD LatM LatS NS LonD LonM LonS EW City State
------ ------ ------ ---- ------ ------ ------ ---- ----------------- -------
41 5 59 N 80 39 0 W Youngstown OH
42 52 48 N 97 23 23 W Yankton SD
46 35 59 N 120 30 36 W Yakima WA
42 16 12 N 71 48 0 W Worcester MA
2020-06-01: jello – Filter JSON and JSON Lines data with Python syntax
2020-06-05: simeji/jid: json incremental digger
jzelinskie/faq: Format Agnostic jQ
faq is a tool intended to be a more flexible “jq”, supporting additional formats. The additional formats are converted into JSON and processed with libjq. Supported formats: BSON, Bencode, JSON, TOML, XML, YAML.
cube2222/jql: Easy JSON Query Processor with a Lispy syntax in Go
2020-06-01: glomRestructuring data, the Python way.
from glom import glom
target = {'a': {'b': {'c': 'd'}}}
glom(target, 'a.b.c') # returns 'd'