JSON

Created: by Pradeep Gowda Updated: Dec 04, 2023 Tagged: json

About JSON

Fast JSON parsers

Query Tools

First see jq.

ObjectPath - The agile query language

In weather readings find cities where temperature is higher than 25°C and the sky is clear.

$..*[@..temp > 25 and @.clouds.all is 0].name

Gron – “Make JSON greppable”

▶ gron "https://api.github.com/repos/tomnomnom/gron/commits?per_page=1" | fgrep "commit.author"
json[0].commit.author = {};
json[0].commit.author.date = "2016-07-02T10:51:21Z";
json[0].commit.author.email = "mail@tomnomnom.com";
json[0].commit.author.name = "Tom Hudson";

Fastgron

fastgron transforms JSON into discrete assignments to make it easier to grep for what you want and see the absolute ‘path’ to it. It eases the exploration of APIs that return large blobs of JSON but have terrible documentation.

fastgron is a high-performance JSON to GRON converter, developed in C++20, utilizing simdjson library. It’s 50x faster than gron on big files (400MB/s input / 1.8GB/s output on M1 Macbook Pro), so it makes big JSON files greppable.


antonmedv/fx: Command-line tool and terminal JSON viewer 🔥


glomRestructuring data, the Python way.

from glom import glom

target = {'a': {'b': {'c': 'd'}}}
glom(target, 'a.b.c')  # returns 'd'

Charting tools

JSON Templating

JSON Schema

JSON Databases

Softmotions/ejdb: EJDB2 — Embeddable JSON Database engine C library. Simple XPath like query language (JQL). Websockets / Android / iOS / React Native / Flutter / Java / Dart / Node.js bindings.

EJDB query language (JQL) syntax inspired by ideas behind XPath and Unix shell pipes. It designed for easy querying and updating sets of JSON documents. See ejdb.


See also: BBEdit JSON format