# JSON

- Page: https://shared.btbytes.com/p/json
- Date: 2019-10-24
- Tags: json

## About JSON

* [The Devil is in the JSON Details · The Factotum](https://thefactotum.xyz/post/the-devil-is-in-the-json-details/)
* [seriot.ch - Parsing JSON is a Minefield 💣](http://seriot.ch/parsing_json.php)


## Fast JSON parsers

- [Mison: A Fast JSON Parser for Data Analytics - Microsoft Research](https://www.microsoft.com/en-us/research/publication/mison-fast-json-parser-data-analytics/) -- not open source as far as I can tell... :(

- [lemire/simdjson: Parsing gigabytes of JSON per second](https://github.com/lemire/simdjson) ; "single header file" library. Feb 2019.


## Query Tools

First see [jq](https://shared.btbytes.com/p/jq).


[ObjectPath - The agile query language](http://objectpath.org/)

> 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](https://github.com/tomnomnom/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](https://github.com/adamritter/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](https://github.com/tomnomnom/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 🔥](https://github.com/antonmedv/fx)
![](https://files.btbytes.com/images/i.imgur.com/TifaVSs.gif)

----

[glom](https://glom.readthedocs.io/en/latest/)Restructuring data, the Python way.

```python
from glom import glom

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


## Charting tools

- [sgreben/jp: dead simple terminal plots from JSON data. single binary, no dependencies. linux, osx, windows.](https://github.com/sgreben/jp)


## JSON Templating

* [Jsonnet - The Data Templating Language](https://jsonnet.org/)
* [The Dhall configuration language](https://dhall-lang.org/#). Dhall = JSON + functions + types + imports
* [Starlark Language - Bazel](https://docs.bazel.build/versions/master/skylark/language.html)
    * [google/starlark-go: Starlark in Go: the Starlark configuration language, implemented in Go](https://github.com/google/starlark-go)
    * [bazelbuild/starlark: Starlark Language](https://github.com/bazelbuild/starlark)


## JSON Schema

* [JSON Resume](https://jsonresume.org/)

## JSON-LD

[Being on The Semantic Web is easy, and, frankly, well worth the bother](https://csvbase.com/blog/13) JSON-LD = (JSON "for Linked Data") is the leading format for encoding Sematic Web metadata. It's _just JSON_, really. There are schemas that lay out the "types" you can use to describe the stuff on your page.

## JSON Databases

[Softmotions/ejdb: EJDB2](https://github.com/Softmotions/ejdb#jql) — 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](https://www.btbytes.com/code/bbedit-json-format)
