package jsont
Install
Dune Dependency
Authors
Maintainers
Sources
sha512=c2b303f0b260fa850ff8710d94f4c586e7eeb773649c4604fe0f77397ba3bf31e1e29f0b7de5422c54b90028cd36263cfa102ce3874a6f8c2a917b0601c168d8
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
.