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.1.tbz
sha256=d58183207b198dc065866239066e074c34f9e139c0d9c4175a38809790e88173
sha512=f7b8529900acb29bc6236d8312d3ebcadbcb3f9d361c8acaed9f7fc7e30527b41a1f3cff80382dde445e6da18a4edc5a9c6758af24affce1022d0741dbd9daeb

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: 11 Oct 2023

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

let () = 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. 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
  4. archetype
  5. atd >= "2.6.0"
  6. atdgen >= "1.13.0" & < "2.8.0" | >= "2.10.0"
  7. atdgen-runtime >= "2.10.0"
  8. avro-compiler
  9. aws-config
  10. aws-s3 < "4.5.1" | >= "4.8.0"
  11. awsm-codegen
  12. bap-radare2
  13. beluga >= "1.1"
  14. bitcoin >= "3.0"
  15. boulangerie
  16. builder-web >= "0.2.0"
  17. caisar
  18. calculon != "0.5"
  19. calculon-redis-lib
  20. calculon-web = "0.6"
  21. camelot >= "1.3.0"
  22. camels
  23. canary
  24. catala = "0.9.0"
  25. cb-check
  26. cbor >= "0.3"
  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. dap
  44. daypack-lib
  45. dblp-api
  46. decoders-yojson >= "0.7.0"
  47. devkit
  48. docfd >= "2.1.0"
  49. docker-api >= "0.2.2"
  50. docker_hub
  51. dot-merlin-reader < "4.6"
  52. dream
  53. dream-inertia
  54. dune-release >= "1.4.0"
  55. dune_deps_extra
  56. eio_main >= "0.10"
  57. elasticsearch-cli = "0.5"
  58. fiat-p256
  59. fit >= "1.2.0"
  60. frama-c < "23.0" | >= "27.0~beta"
  61. fred
  62. frenetic
  63. fstar
  64. gapi-ocaml >= "0.4.3"
  65. gdbprofiler
  66. gemini
  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. hl_yaml
  85. hockmd
  86. horned_worm
  87. hpack
  88. hsluv
  89. httph
  90. index-bench
  91. ip2location
  92. ip2locationio
  93. irmin-bench < "3.0.0"
  94. irmin-graphql >= "2.2.0"
  95. irmin-tezos
  96. jasmin
  97. jhupllib
  98. jose
  99. js_of_ocaml-compiler
  100. jsonrpc < "1.6.0"
  101. jsonschema2atd
  102. jupyter
  103. jupyter-kernel
  104. jwto
  105. kappa-library
  106. karamel
  107. kind2
  108. kremlin < "transition"
  109. kubecaml
  110. lablgtk3-extras >= "3.0.1"
  111. lambdapi
  112. learn-ocaml
  113. letsencrypt
  114. letters
  115. libsail
  116. linol >= "0.2"
  117. linol-eio
  118. linol-lwt
  119. lockfree >= "0.3.1"
  120. logs-async-reporter >= "1.3"
  121. lsp
  122. melange-json = "1.2.0"
  123. melange-json-native
  124. merlin = "3.8.0" | >= "4.6-412"
  125. metadb
  126. mirage-crypto-ec
  127. mjson
  128. monorobot
  129. mopsa
  130. morbig >= "0.11.0"
  131. multicore-bench
  132. mutaml >= "0.2"
  133. nloge
  134. nsq
  135. obuilder
  136. ocaml-lsp-server
  137. ocaml-protoc-plugin >= "6.1.0"
  138. ocaml_db_model
  139. ocaml_pgsql_model
  140. ocamleditor >= "1.15.2-ocaml414"
  141. ocf
  142. ocsigen-start
  143. odoc >= "2.0.0" & < "2.1.1" | >= "2.3.0"
  144. odoc-driver
  145. oframl
  146. oidc
  147. ojs-base
  148. ojs_base
  149. ometrics < "0.2.0"
  150. openai-gym
  151. openapi < "1.0.0"
  152. openapi_router
  153. openstellina
  154. opium >= "0.19.0"
  155. oraft
  156. orun
  157. osh
  158. ozulip
  159. pa_ppx
  160. pandoc
  161. pbrt_yojson
  162. pds-reachability >= "0.2.3"
  163. petr4
  164. phylogenetics >= "0.2.0"
  165. piece_rope
  166. pkcs11-driver >= "1.0.0"
  167. ppx_deriving_jsonschema
  168. ppx_deriving_yojson
  169. ppx_protocol_conv_json < "5.0.0" | >= "5.2.1"
  170. ppx_yojson
  171. ppx_yojson_conv < "v0.13.0"
  172. ppx_yojson_conv_lib
  173. prof_spacetime
  174. qmp >= "0.19.0"
  175. quests
  176. r2pipe
  177. radare2
  178. rdf < "1.0.0"
  179. records = "0.6.0" | >= "1.0.0"
  180. repr-bench
  181. rpclib >= "6.0.0"
  182. rungen
  183. SZXX
  184. safemoney
  185. sail < "0.15"
  186. saturn
  187. saturn_lockfree
  188. satyrographos != "0.0.2.7"
  189. savvy
  190. semver2
  191. serde_json
  192. sihl < "0.2.0" | >= "0.3.0~rc2"
  193. sihl-core
  194. slack
  195. slug
  196. smaws-lib
  197. smtml >= "0.2.2"
  198. spotify-web-api
  199. swagger
  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. u2f
  209. user-agent-parser
  210. vecosek
  211. vercel
  212. vscoq-language-server
  213. wasm_of_ocaml-compiler
  214. webauthn
  215. why3find
  216. xapi-rrd >= "1.9.0"
  217. zanuda
  218. zarr

Conflicts

None

OCaml

Innovation. Community. Security.