package yojson

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

Install

Dune Dependency

Authors

Maintainers

Sources

yojson-2.1.2.tbz
sha256=59f2f1abbfc8a7ccbdbf608894e5c75e8a76006e34899254446f83e200dfb4f9
sha512=309cba7568dec51de20c7ab8df033258c275b8d58b0a36a66b26e673a3bc050cbd7e39ff8fe4796e89263e125bcc21e04dc36a394f3cc201956887eee1fb281a

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: 27 Nov 2023

README

Yojson: JSON library for OCaml

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 *)

let () = Format.printf "Parsed to %a" Yojson.Safe.pp json

Related tooling

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. ocaml >= "4.02.3"
  4. dune >= "2.7"

Dev Dependencies (2)

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

  1. 0install >= "2.18"
  2. abella >= "2.0.8"
  3. acgtk >= "1.3.2"
  4. archetype
  5. atd >= "2.6.0"
  6. atdgen < "1.9.0" | >= "1.13.0" & < "2.8.0" | >= "2.10.0"
  7. atdgen-runtime >= "2.10.0"
  8. avro-compiler
  9. aws < "1.0.0"
  10. aws-config
  11. aws-s3 >= "1.1.0" & < "4.5.1" | >= "4.8.0"
  12. awsm-codegen
  13. bap-radare2
  14. beluga >= "1.1"
  15. bitcoin >= "3.0"
  16. boulangerie
  17. caisar
  18. calculon != "0.5"
  19. calculon-redis-lib
  20. camelot >= "1.3.0"
  21. camels
  22. canary
  23. catala >= "0.9.0"
  24. cb-check
  25. cbor != "0.2"
  26. cconv-ppx
  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"
  34. current_docker
  35. current_examples >= "0.4"
  36. current_git
  37. current_github
  38. current_gitlab
  39. current_slack
  40. current_ssh
  41. current_web >= "0.4"
  42. cwe_checker
  43. dap
  44. datakit-ci >= "0.12.3"
  45. daypack-lib
  46. decoders-yojson >= "0.7.0"
  47. deriving-yojson
  48. devkit >= "0.4"
  49. docfd >= "2.1.0"
  50. docker-api >= "0.2.2"
  51. docker_hub
  52. dot-merlin-reader != "4.4~5.0.preview" & < "4.6"
  53. dream
  54. dune-release >= "1.4.0"
  55. earlybird < "1.0.0"
  56. eio_main >= "0.10"
  57. facebook-sdk < "0.3.1"
  58. fiat-p256
  59. fit >= "1.2.0"
  60. frama-c >= "19.0" & < "23.0" | >= "27.0~beta"
  61. frenetic >= "3.2.0"
  62. fstar >= "0.9.3.0-beta1"
  63. gapi-ocaml < "0.3.5" | >= "0.4.3"
  64. gdbprofiler >= "0.2"
  65. gemini
  66. gen-bs >= "0.1.0"
  67. github != "4.0.0"
  68. github-data
  69. gitlab
  70. goblint >= "2.0.0"
  71. goblint-cil >= "1.8.0"
  72. gopcaml-mode-merlin < "0.0.6"
  73. gradescope_submit
  74. graphql < "0.9.0" | >= "0.14.0"
  75. graphql-async >= "0.14.0"
  76. graphql-cohttp >= "0.13.0"
  77. graphql-lwt >= "0.14.0"
  78. graphql_ppx
  79. gremlin
  80. guardian
  81. h2
  82. hacl_x25519
  83. hilite < "0.3.0"
  84. hockmd
  85. horned_worm
  86. hpack
  87. hsluv
  88. httph
  89. index-bench
  90. iocaml
  91. iocaml-kernel
  92. ip2location
  93. ip2locationio
  94. irmin-bench < "3.0.0"
  95. irmin-graphql >= "2.2.0"
  96. irmin-tezos
  97. jasmin
  98. jhupllib
  99. jose
  100. js_of_ocaml-compiler
  101. json-pointer
  102. json-predicate
  103. jsonrpc < "1.6.0"
  104. jsonschema2atd
  105. jupyter
  106. jupyter-kernel
  107. jwto
  108. kappa-library
  109. karamel
  110. ketrew
  111. kind2
  112. kremlin < "transition"
  113. kubecaml
  114. lablgtk3-extras >= "3.0.1"
  115. lablqt
  116. lambdapi >= "2.0.0"
  117. learn-ocaml
  118. letsencrypt
  119. letters
  120. libsail
  121. linol >= "0.2"
  122. linol-lwt
  123. lockfree >= "0.3.0"
  124. logs-async-reporter >= "1.3"
  125. lsp
  126. merlin = "3.0.3" | = "3.8.0" | >= "4.6-412"
  127. merlin-acme
  128. metadb
  129. mezzo
  130. minimal >= "1.1.0"
  131. mirage-crypto-ec
  132. mjson
  133. monorobot
  134. morbig >= "0.11.0"
  135. multicore-bench
  136. netml
  137. nloge
  138. nsq >= "0.2.4"
  139. obuilder
  140. ocaml-gist
  141. ocaml-lsp-server
  142. ocaml-webworker
  143. ocaml_db_model
  144. ocaml_pgsql_model
  145. ocamleditor >= "1.15.2-ocaml414"
  146. ocf
  147. oclaunch < "0.2.1"
  148. ocsigen-start
  149. odoc >= "2.0.0" & < "2.1.1" | >= "2.3.0"
  150. oframl
  151. ogen = "0.1.2"
  152. oidc
  153. ojs-base != "0.2.0"
  154. ojs_base
  155. ometrics < "0.2.0"
  156. opam2web >= "2.0"
  157. openai-gym
  158. openapi
  159. openapi_router
  160. openstellina
  161. opium >= "0.19.0"
  162. oraft
  163. orun
  164. osh
  165. ozulip
  166. pa_ppx
  167. pandoc
  168. pbrt_yojson
  169. pds-reachability >= "0.2.3"
  170. petr4
  171. phylogenetics >= "0.2.0"
  172. piece_rope
  173. pkcs11-driver >= "1.0.0"
  174. plist >= "1.0.0"
  175. podge >= "0.4"
  176. ppx_deriving_protocol < "0.8.1"
  177. ppx_deriving_yojson >= "3.4"
  178. ppx_graphql
  179. ppx_json_types
  180. ppx_protocol_conv = "2.0.0"
  181. ppx_protocol_conv_json = "3.1.3" | >= "5.2.1"
  182. ppx_yojson
  183. ppx_yojson_conv < "v0.13.0"
  184. ppx_yojson_conv_lib
  185. prof_spacetime
  186. qmp >= "0.19.0"
  187. quests
  188. r2pipe
  189. radare2
  190. rdf >= "0.9.0"
  191. records = "0.6.0" | >= "1.0.0"
  192. repr-bench
  193. rpc = "2.2.0"
  194. rpclib >= "6.0.0"
  195. rubytt
  196. rungen
  197. SZXX
  198. safemoney
  199. sail < "0.15"
  200. saturn
  201. saturn_lockfree
  202. satyrographos != "0.0.2.7"
  203. semver2
  204. serde_json
  205. sihl < "0.2.0" | >= "0.3.0~rc2"
  206. sihl-core
  207. slacko < "0.14.1"
  208. slug
  209. sparrow
  210. sphinxcontrib-ocaml
  211. spotify-web-api
  212. swagger
  213. tdigest < "2.1.0"
  214. telegraml < "2.2.0"
  215. testrunner
  216. textmate-language >= "0.3.4"
  217. textrazor >= "0.1.1"
  218. tezos-context-hash-irmin
  219. themoviedb
  220. tidy_email_sendgrid
  221. timedesc < "0.8.0"
  222. timedesc-json
  223. timere < "0.4.0"
  224. transmission-rpc
  225. u2f
  226. usbmux
  227. user-agent-parser
  228. vecosek
  229. vercel
  230. vscoq-language-server
  231. webauthn
  232. xapi-rrd >= "1.9.0"
  233. zanuda

Conflicts

None