Skip to content

tos-kamiya/json2jqq

Repository files navigation

Build Status

json2jqq

Suppose you got a json data, which you do not know structure, but have to analyze... json2qq is here.

A CLI Tool to extract query templates for jq tool from json data.

Installation

Install:

sudo pip3 install git+https://github.com/tos-kamiya/json2jqq.git

Uninstall:

sudo pip3 uninstall json2jqq

Tutorial

Extract a query template for jq from json data.

$ bash
$ cat > myrepos.json <<EOF
[
  { "author": "Toshihiro Kamiya", "url": "https://github.com/tos-kamiya/json2jqq/" },
  { "author": "Toshihiro Kamiya", "url": "https://github.com/tos-kamiya/giftplayer/" }
]
EOF
$ json2jqq myrepos.json
.[].author
.[].url

Each of extracted queries will work as jq's filter.

$ jq '.[].url' myrepos.json
"https://github.com/tos-kamiya/json2jqq/"
"https://github.com/tos-kamiya/giftplayer/"

Option -s will show a sample value for each query.

$ json2jqq -s myrepos.json
.[].author	Toshihiro Kamiya
.[].url	https://github.com/tos-kamiya/json2jqq/

About

CLI Tool to extract query templates for jq tool from json data

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages