package jsont
Install
Dune Dependency
Authors
Maintainers
Sources
sha512=e3f403d12283ac932b08254bf5d5debd3dbec1c9022e21f69b1be3fb74727da3ae7d26510eba6770451a6c711987884d93a3ee5baa94ca3a07166ad779206da5
Description
Jsont is an OCaml library for declarative JSON data manipulation. It provides:
- Combinators for describing JSON data using the OCaml values of your choice. The descriptions can be used by generic functions to decode, encode, query and update JSON data without having to construct a generic JSON representation.
- A JSON codec with optional text location tracking and layout preservation. The codec is compatible with effect-based concurrency.
The descriptions are independent from the codec and can be used by third-party processors or codecs.
Jsont is distributed under the ISC license. It has no dependencies.
The codec is optional and depends on the bytesrw
library. The JavaScript
support is optional and depends on the brr
library.
Homepage: https://erratique.ch/software/jsont/
README
Jsont – Declarative JSON data manipulation for OCaml
Jsont is an OCaml library for declarative JSON data manipulation. It provides:
Combinators for describing JSON data using the OCaml values of your choice. The descriptions can be used by generic functions to decode, encode, query and update JSON data without having to construct a generic JSON representation.
A JSON codec with optional text location tracking and layout preservation. The codec is compatible with effect-based concurrency.
The descriptions are independent from the codec and can be used by third-party processors or codecs.
Jsont is distributed under the ISC license. It has no dependencies. The codec is optional and depends on the bytesrw
library. The JavaScript support is optional and depends on the brr
library.
Homepage: https://erratique.ch/software/jsont/
Installation
Jsont can be installed with opam
:
opam install jsont
opam install jsont bytesrw # For the optional codec support
opam install jsont brr # For the optional JavaScript support
opam install jsont bytesrw cmdliner # For the jsont tool
Documentation
The documentation can be consulted online or via odig doc jsont
.
Questions are welcome but better asked on the OCaml forum than on the issue tracker.
Examples
A few examples can be found in the documentation and in the test directory. The test/topojson.ml
and test/geojson.ml
show use of the library on concrete JSON data formats.
Paper & technique
If you want to understand the finally tagged technique used by the library, the paper/soup.ml
source implements the abridged version of the underlying data type used in the paper.
Acknowledgments
A grant from the OCaml Software Foundation helped to bring the first public release of jsont
.