package yojson

  1. Overview
  2. Docs
Yojson is an optimized parsing and printing library for the JSON format

Install

dune-project
 Dependency

Authors

Maintainers

Sources

yojson-2.0.1.tbz
sha256=8bc8bc722a4a94656a58394f17f9f8a406267343ab87d77202db930584a0c836
sha512=93ebabd3247f1b5826827472229188c5ac1b4d2395eb8121a22b35acd773eedd290e6b8de1f067020fc868da7c05a60408091eebc0b305a67408d558a3a94c10

Description

Yojson is an optimized parsing and printing library for the JSON format.

ydump is a pretty-printing command-line program provided with the yojson package.

Published: 07 Jul 2022

README

Yojson: JSON library for OCaml

Build Status

This library parses JSON data into a nested OCaml tree data structure.

Library documentation

Currently at https://ocaml-community.github.io/yojson/

Examples

A simple example on how to parse JSON from a string literal.

let json_string = {|
  {"number" : 42,
   "string" : "yes",
   "list": ["for", "sure", 42]}|}
(* val json_string : string *)

let json = Yojson.Safe.from_string json_string
(* val json : Yojson.Safe.t *)

Format.printf "Parsed to %a" Yojson.Safe.pp json

Yojson is a pretty common choice for parsing JSON in OCaml, as such it is the base for a number of tools and libraries that are built on top of it.

  • ppx_deriving_yojson to automatically generate code that converts between Yojson.Safe.t and custom OCaml types
  • ppx_yojson_conv, an alternative to ppx_deriving_yojson from Jane Street with different design decisions
  • atd, generates mapping code from .atd specification files and can be used in multiple languages
  • jsonm is an alternate JSON parser that parses JSON into a stream of items, so the complete data structure does not have to be in memory.

Help wanted

Yojson is developed and maintained by volunteers — users like you. Various issues are in need of attention. If you'd like to contribute, please leave a comment on the issue you're interested in, or create a new issue. Experienced contributors will guide you as needed.

There are many simple ways of making a positive impact. For example, you can...

  • Use the software in your project.
  • Give a demo to your colleagues.
  • Share the passion on your blog.
  • Tweet about what you're doing with Yojson.
  • Report difficulties by creating new issues. We'll triage them.
  • Ask questions on StackOverflow.
  • Answer questions on StackOverflow.
  • Discuss usage on the OCaml forums.
  • Pick a task that's easy for you.

Check out in particular good first time issues and other issues with which we could use some help.

License

Yojson is licensed under the 3-clause BSD license, see LICENSE.md for details.

Dependencies (4)

  1. seq >= "0.2.2"
  2. cppo build
  3. dune >= "2.0"
  4. ocaml >= "4.02.3"

Dev Dependencies (2)

  1. odoc with-doc
  2. alcotest with-test & >= "0.8.5"

  1. 0install >= "2.18"
  2. acgtk
  3. anthropic
  4. archetype
  5. atd >= "2.6.0"
  6. atdgen >= "1.13.0" & < "2.8.0" | >= "2.10.0"
  7. avro-compiler
  8. aws-config
  9. aws-s3 < "4.5.1" | >= "4.8.0"
  10. awsm-codegen
  11. bap-radare2
  12. bitcoin >= "3.0"
  13. boulangerie
  14. builder-web >= "0.2.0"
  15. caisar
  16. calculon != "0.5"
  17. calculon-redis-lib
  18. calculon-web = "0.6"
  19. camelot >= "1.3.0"
  20. camels
  21. canary
  22. catala = "0.9.0"
  23. cb-check
  24. cbor >= "0.3"
  25. cconv-ppx
  26. chess_com_api
  27. colibrics
  28. comby-semantic
  29. commons
  30. containers >= "3.9"
  31. coq-lsp
  32. coq-of-ocaml
  33. coq-serapi >= "8.10.0+0.7.0" & < "8.20.0+0.20.0"
  34. current_docker
  35. current_examples
  36. current_git
  37. current_github
  38. current_gitlab
  39. current_slack
  40. current_ssh
  41. current_web
  42. dap
  43. daypack-lib
  44. dblp-api
  45. decoders-yojson >= "0.7.0"
  46. devkit
  47. docker-api >= "0.2.2"
  48. docker_hub
  49. dot-merlin-reader < "4.9"
  50. dream
  51. dream-inertia
  52. dune-release >= "1.4.0"
  53. dune_deps_extra
  54. elasticsearch-cli = "0.5"
  55. elpi >= "3.3.1"
  56. fehu
  57. fiat-p256
  58. frama-c
  59. fred
  60. frenetic
  61. fstar
  62. gapi-ocaml
  63. gdbprofiler
  64. gemini < "0.3.0"
  65. gendarme-json
  66. github != "4.0.0"
  67. github-data
  68. gitlab
  69. goblint >= "2.0.0"
  70. goblint-cil >= "1.8.0"
  71. gopcaml-mode-merlin < "0.0.6"
  72. graphql < "0.9.0" | >= "0.14.0"
  73. graphql-async >= "0.14.0"
  74. graphql-cohttp >= "0.13.0"
  75. graphql-lwt >= "0.14.0"
  76. graphql_ppx
  77. gremlin
  78. h2
  79. hacl_x25519
  80. handlebars-ml
  81. hilite < "0.3.0"
  82. hl_yaml
  83. hockmd
  84. horned_worm
  85. hpack
  86. hsluv
  87. httph
  88. huml
  89. huml-cli
  90. index-bench
  91. ip2location
  92. ip2locationio
  93. irmin-graphql
  94. irmin-tezos
  95. jasmin
  96. jhupllib
  97. jose
  98. js_of_ocaml-compiler < "6.0.1"
  99. jsonrpc < "1.6.0" | >= "1.23.1"
  100. jsonschema
  101. jsonschema2atd
  102. jupyter
  103. jupyter-kernel
  104. jwto
  105. kappa-library
  106. karamel
  107. kaun >= "1.0.0~alpha1"
  108. kind2
  109. kremlin < "transition"
  110. kubecaml
  111. lablgtk3-extras >= "3.0.1"
  112. lambdapi
  113. learn-ocaml
  114. letsencrypt
  115. letters
  116. libsail
  117. lichess_api
  118. linol >= "0.2"
  119. linol-eio
  120. linol-lwt
  121. lsp
  122. melange-json = "1.2.0"
  123. melange-json-native
  124. merlin != "4.5-411"
  125. metadb
  126. mirage-crypto-ec
  127. mjson
  128. monorobot
  129. mopsa
  130. morbig >= "0.11.0"
  131. mutaml
  132. nloge
  133. nsq
  134. obuilder
  135. ocaml-lsp-server
  136. ocaml-protoc-plugin >= "6.1.0"
  137. ocaml_db_model
  138. ocaml_pgsql_model
  139. ocf
  140. ocsigen-start
  141. odoc-driver
  142. oframl
  143. oidc
  144. ojs-base
  145. ojs_base
  146. ometrics < "0.2.0"
  147. openai-gym
  148. openapi < "1.0.0"
  149. openapi_router
  150. opencage
  151. openstellina
  152. opium >= "0.19.0"
  153. oraft
  154. orun
  155. osh
  156. ozulip
  157. pa_ppx < "0.19"
  158. pandoc
  159. pbrt_yojson
  160. pds-reachability >= "0.2.3"
  161. petr4
  162. pgn_parser
  163. phylogenetics >= "0.2.0"
  164. pkcs11 >= "1.0.0"
  165. pkcs11-driver >= "1.0.0"
  166. ppx_deriving_jsonschema
  167. ppx_deriving_yojson
  168. ppx_protocol_conv_json < "5.0.0" | >= "5.2.1"
  169. ppx_yojson
  170. ppx_yojson_conv < "v0.13.0"
  171. ppx_yojson_conv_lib
  172. prof_spacetime
  173. qmp >= "0.19.0"
  174. quests
  175. r2pipe
  176. radare2
  177. rdf < "1.0.0"
  178. records = "0.6.0" | >= "1.0.0"
  179. repr-bench
  180. rocq-devtools
  181. rpclib
  182. rungen
  183. SZXX
  184. safemoney
  185. saga
  186. sail < "0.15"
  187. satyrographos != "0.0.2.7"
  188. savvy
  189. semver2
  190. sihl < "0.2.0" | >= "0.3.0~rc2"
  191. sihl-core
  192. slack
  193. slug
  194. smaws-lib
  195. smtml >= "0.7.0"
  196. snf_mcp
  197. spotify-web-api
  198. swagger
  199. talon
  200. tdigest < "2.1.0"
  201. textmate-language >= "0.3.4"
  202. textrazor >= "0.1.1"
  203. tezos-context-hash-irmin
  204. tidy_email_sendgrid
  205. timedesc < "0.8.0"
  206. timedesc-json
  207. timere < "0.4.0"
  208. user-agent-parser
  209. vecosek
  210. vercel
  211. vscoq-language-server < "2.3.3"
  212. vsrocq-language-server
  213. webauthn
  214. why3find
  215. xapi-rrd >= "1.9.0"
  216. yojson-bench = "2.0.1"
  217. zanuda
  218. zarr

Conflicts

None