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.0.0.tbz
sha256=ab5d863f7f951a8f7fb4a708399ca2da2cf139a5e0af7818145c20295420cb1a
sha512=3ea982dbeef7ec8da54d29124ddb8b86f90583eb96ed3947851cedec9e3d2d47b981e3465d41f2c94943e6865ba6a9a51c6f0252efa6df2386d398b679aae8f2

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: 09 Jun 2022

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

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

Conflicts

None