A pretty-printer for files containing more than one json object.
Overview
Consider the following file:
{"abc": "def"}{"ham": "spam", "numbers": [1, 2, 3]}{"foo": "bar"}
The contents of this file do not constitute a valid json object when taken as a whole. Instead, the file contains a stream of json objects. Jsoncat will pretty-print this file as so:
{
"abc": "def"
}
{
"ham": "spam",
"numbers": [
1,
2,
3
]
}
{
"foo": "bar"
}
Installation
pip install jsoncatcmd
Usage
Read from a file:
jsoncat myfile.json
Read from stdin:
cat myfile.json | jsoncat
Read a gzipped json stream:
cat myfile.json.gz | zcat | jsoncat