jonathanpoelen / flatjson

Flatten keys and values of a JSON file in a greppable format

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Flatten keys and values of a JSON file in a greppable format.

Usage

Usage: flatjson [-q | -Q] [FILE]...
 -q  string are in single quote
 -Q  string are in double quote

Example

flatjson.py <<<'{"key1": "value1",
"key2": [1,5,7],
"key3": {"a": "x", "b": 4}
}'

output:

.key1 = value1
.key2[0] = 1
.key2[1] = 5
.key2[2] = 7
.key3.a = x
.key3.b = 4

About

Flatten keys and values of a JSON file in a greppable format

License:MIT License


Languages

Language:Python 74.8%Language:Shell 25.2%