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.2.2.tbz
sha256=9abfad8c9a79d4723ad2f6448e669c1e68dbfc87cc54a1b7c064b0c90912c595
sha512=ac52eae3ca1d3129a7885ca638e6ae5bcfc387598a82cc30d3e4988fd154f1756719c399f96e950d898c79a6dbd4ccc44b6f468bcafbd620e6945a0415b41e0c

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: 29 Jun 2024

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 (3)

  1. seq >= "0.2.2"
  2. ocaml >= "4.02.3"
  3. 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. forester >= "3.1.0"
  61. frama-c >= "19.0" & < "23.0" | >= "27.0~beta"
  62. fred
  63. frenetic >= "3.2.0"
  64. fstar >= "0.9.3.0-beta1"
  65. gapi-ocaml < "0.3.5" | >= "0.4.3"
  66. gdbprofiler >= "0.2"
  67. gemini
  68. gen-bs >= "0.1.0"
  69. github != "4.0.0"
  70. github-data
  71. gitlab
  72. goblint >= "2.0.0"
  73. goblint-cil >= "1.8.0"
  74. gopcaml-mode-merlin < "0.0.6"
  75. gradescope_submit
  76. graphql < "0.9.0" | >= "0.14.0"
  77. graphql-async >= "0.14.0"
  78. graphql-cohttp >= "0.13.0"
  79. graphql-lwt >= "0.14.0"
  80. graphql_ppx
  81. gremlin
  82. guardian
  83. h2
  84. hacl_x25519
  85. hilite < "0.3.0"
  86. hl_yaml
  87. hockmd
  88. horned_worm
  89. hpack
  90. hsluv
  91. httph
  92. index-bench
  93. iocaml
  94. iocaml-kernel
  95. ip2location
  96. ip2locationio
  97. ip2whois
  98. irmin-bench < "3.0.0"
  99. irmin-graphql >= "2.2.0"
  100. irmin-tezos
  101. jasmin
  102. jhupllib
  103. jose
  104. js_of_ocaml-compiler
  105. json-pointer
  106. json-predicate
  107. jsonrpc < "1.6.0"
  108. jsonschema2atd
  109. jupyter
  110. jupyter-kernel
  111. jwto
  112. kappa-library
  113. karamel
  114. ketrew
  115. kind2
  116. kremlin < "transition"
  117. kubecaml
  118. lablgtk3-extras >= "3.0.1"
  119. lablqt
  120. lambdapi >= "2.0.0"
  121. learn-ocaml
  122. letsencrypt
  123. letters
  124. libsail
  125. linol >= "0.2"
  126. linol-eio
  127. linol-lwt
  128. lockfree >= "0.3.0"
  129. logs-async-reporter >= "1.3"
  130. lsp
  131. merlin = "3.0.3" | = "3.8.0" | >= "4.6-412"
  132. merlin-acme
  133. metadb
  134. mezzo
  135. minimal >= "1.1.0"
  136. mirage-crypto-ec
  137. mjson
  138. monorobot
  139. mopsa
  140. morbig >= "0.11.0"
  141. multicore-bench
  142. netml
  143. nloge
  144. nsq >= "0.2.4"
  145. obuilder
  146. ocaml-gist
  147. ocaml-lsp-server
  148. ocaml-protoc-plugin >= "6.1.0"
  149. ocaml-webworker
  150. ocaml_db_model
  151. ocaml_pgsql_model
  152. ocamleditor >= "1.15.2-ocaml414"
  153. ocf
  154. oclaunch < "0.2.1"
  155. ocsigen-start
  156. odoc >= "2.0.0" & < "2.1.1" | >= "2.3.0"
  157. oframl
  158. ogen = "0.1.2"
  159. oidc
  160. ojs-base != "0.2.0"
  161. ojs_base
  162. ometrics < "0.2.0"
  163. opam2web >= "2.0"
  164. openai-gym
  165. openapi
  166. openapi_router
  167. openstellina
  168. opium >= "0.19.0"
  169. oraft
  170. orun
  171. osh
  172. ozulip
  173. pa_ppx
  174. pandoc
  175. pbrt_yojson
  176. pds-reachability >= "0.2.3"
  177. petr4
  178. phylogenetics >= "0.2.0"
  179. piece_rope
  180. pkcs11-driver >= "1.0.0"
  181. plist >= "1.0.0"
  182. podge >= "0.4"
  183. ppx_deriving_protocol < "0.8.1"
  184. ppx_deriving_yojson >= "3.4"
  185. ppx_graphql
  186. ppx_json_types
  187. ppx_protocol_conv = "2.0.0"
  188. ppx_protocol_conv_json = "3.1.3" | >= "5.2.1"
  189. ppx_yojson
  190. ppx_yojson_conv < "v0.13.0"
  191. ppx_yojson_conv_lib
  192. prof_spacetime
  193. qmp >= "0.19.0"
  194. quests
  195. r2pipe
  196. radare2
  197. rdf >= "0.9.0"
  198. records = "0.6.0" | >= "1.0.0"
  199. repr-bench
  200. rpc = "2.2.0"
  201. rpclib >= "6.0.0"
  202. rubytt
  203. rungen
  204. SZXX
  205. safemoney
  206. sail < "0.15"
  207. saturn
  208. saturn_lockfree
  209. satyrographos != "0.0.2.7"
  210. semver2
  211. serde_json
  212. sihl < "0.2.0" | >= "0.3.0~rc2"
  213. sihl-core
  214. slack
  215. slacko < "0.14.1"
  216. slug
  217. smtml >= "0.2.2"
  218. sparrow
  219. sphinxcontrib-ocaml
  220. spotify-web-api
  221. starred_ml
  222. swagger
  223. tdigest < "2.1.0"
  224. telegraml < "2.2.0"
  225. testrunner
  226. textmate-language >= "0.3.4"
  227. textrazor >= "0.1.1"
  228. tezos-context-hash-irmin
  229. themoviedb
  230. tidy_email_sendgrid
  231. timedesc < "0.8.0"
  232. timedesc-json
  233. timere < "0.4.0"
  234. transmission-rpc
  235. u2f
  236. usbmux
  237. user-agent-parser
  238. vecosek
  239. vercel
  240. vscoq-language-server
  241. webauthn
  242. why3find
  243. xapi-rrd >= "1.9.0"
  244. yojson-five >= "2.2.2"
  245. zanuda

Conflicts

None

OCaml

Innovation. Community. Security.