Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alexflint/jsoncat
Streaming json pretty-printer
https://github.com/alexflint/jsoncat
Last synced: 22 days ago
JSON representation
Streaming json pretty-printer
- Host: GitHub
- URL: https://github.com/alexflint/jsoncat
- Owner: alexflint
- Created: 2015-07-16T00:02:39.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-07-16T00:20:46.000Z (over 9 years ago)
- Last Synced: 2024-09-18T05:00:34.805Z (about 2 months ago)
- Language: Python
- Size: 113 KB
- Stars: 2
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
A pretty-printer for files containing more than one json object.
## Overview
Consider the following file:
```json
{"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:
```json
{
"abc": "def"
}
{
"ham": "spam",
"numbers": [
1,
2,
3
]
}
{
"foo": "bar"
}
```## Installation
```bash
pip install jsoncatcmd
```## Usage
Read from a file:
```bash
jsoncat myfile.json
```Read from stdin:
```bash
cat myfile.json | jsoncat
```Read a gzipped json stream:
```bash
cat myfile.json.gz | zcat | jsoncat
```