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

Conflicts

None

OCaml

Innovation. Community. Security.