A low-level JSON and JSON5 parsing and pretty-printing library for OCaml.
Yojson is a low-level JSON parsing and pretty-printing library for OCaml. It converts JSON and JSON5 data into nested OCaml tree data structures, providing a foundational tool for JSON handling in OCaml applications. It solves the problem of efficiently parsing and manipulating JSON data within OCaml's type-safe environment.
OCaml developers who need to parse, generate, or manipulate JSON data in their applications, especially those building tools or libraries that require JSON support.
Developers choose Yojson because it's a widely adopted, reliable base for JSON handling in OCaml, with support for both JSON and JSON5, and integrates well with the OCaml ecosystem through related tooling for automatic type conversions.
Low-level JSON parsing and pretty-printing library for OCaml
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Parses both standard JSON and the more lenient JSON5 format, providing flexibility for diverse data sources, as highlighted in the README's key features.
Offers direct access to parsed JSON as OCaml tree data structures, enabling fine-grained manipulation for custom tooling, as shown in the example code snippets.
Includes built-in functions for human-readable JSON output, useful for debugging and logging, demonstrated in the README with Yojson.Safe.pp.
Acts as a base for tooling like ppx_deriving_yojson and ppx_yojson_conv, facilitating automatic type conversion and enhancing OCaml community productivity.
Requires external libraries or manual code for type-safe JSON conversions, adding complexity compared to all-in-one solutions, as noted in the related tooling section.
Parses JSON into complete tree structures, making it less efficient for very large datasets where streaming alternatives like jsonm are better suited.
Maintained by community volunteers, as stated in the README, which may result in slower issue resolution or updates compared to commercially supported libraries.