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.1.tbz
sha256=8bc8bc722a4a94656a58394f17f9f8a406267343ab87d77202db930584a0c836
sha512=93ebabd3247f1b5826827472229188c5ac1b4d2395eb8121a22b35acd773eedd290e6b8de1f067020fc868da7c05a60408091eebc0b305a67408d558a3a94c10

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

Conflicts

None

OCaml

Innovation. Community. Security.