package yojson
Install
Dune Dependency
Authors
Maintainers
Sources
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
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 betweenYojson.Safe.t
and custom OCaml typesppx_yojson_conv
, an alternative toppx_deriving_yojson
from Jane Street with different design decisionsatd
, generates mapping code from.atd
specification files and can be used in multiple languagesjsonm
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.
-
0install
>= "2.18"
-
abella
>= "2.0.8"
- acgtk
- archetype
-
atd
>= "2.6.0"
-
atdgen
>= "1.13.0" & < "2.8.0" | >= "2.10.0"
-
atdgen-runtime
>= "2.10.0"
- avro-compiler
- aws-config
-
aws-s3
< "4.5.1" | >= "4.8.0"
- awsm-codegen
- bap-radare2
-
beluga
>= "1.1"
-
bitcoin
>= "3.0"
- boulangerie
-
builder-web
>= "0.2.0"
- caisar
-
calculon
!= "0.5"
- calculon-redis-lib
-
calculon-web
= "0.6"
-
camelot
>= "1.3.0"
- camels
- canary
-
catala
= "0.9.0"
- cb-check
-
cbor
>= "0.3"
- cconv-ppx
- colibrics
- comby-semantic
- commons
-
containers
>= "3.9"
- coq-lsp
- coq-of-ocaml
-
coq-serapi
>= "8.10.0+0.7.0" & < "8.20.0+0.20.0"
- current_docker
-
current_examples
>= "0.4"
- current_git
- current_github
- current_gitlab
- current_slack
- current_ssh
-
current_web
>= "0.4"
- dap
- daypack-lib
- dblp-api
-
decoders-yojson
>= "0.7.0"
- devkit
-
docfd
>= "2.1.0"
-
docker-api
>= "0.2.2"
- docker_hub
-
dot-merlin-reader
< "4.6"
- dream
- dream-inertia
-
dune-release
>= "1.4.0"
- dune_deps_extra
-
eio_main
>= "0.10"
-
elasticsearch-cli
= "0.5"
- fiat-p256
-
fit
>= "1.2.0"
-
frama-c
< "23.0" | >= "27.0~beta"
- fred
- frenetic
- fstar
-
gapi-ocaml
>= "0.4.3"
- gdbprofiler
- gemini
-
github
!= "4.0.0"
- github-data
- gitlab
-
goblint
>= "2.0.0"
-
goblint-cil
>= "1.8.0"
-
gopcaml-mode-merlin
< "0.0.6"
- gradescope_submit
-
graphql
< "0.9.0" | >= "0.14.0"
-
graphql-async
>= "0.14.0"
-
graphql-cohttp
>= "0.13.0"
-
graphql-lwt
>= "0.14.0"
- graphql_ppx
- gremlin
- guardian
- h2
- hacl_x25519
-
hilite
< "0.3.0"
- hl_yaml
- hockmd
- horned_worm
- hpack
- hsluv
- httph
- index-bench
- ip2location
- ip2locationio
-
irmin-bench
< "3.0.0"
-
irmin-graphql
>= "2.2.0"
- irmin-tezos
- jasmin
- jhupllib
- jose
- js_of_ocaml-compiler
-
jsonrpc
< "1.6.0"
- jsonschema2atd
- jupyter
- jupyter-kernel
- jwto
- kappa-library
- karamel
- kind2
-
kremlin
< "transition"
- kubecaml
-
lablgtk3-extras
>= "3.0.1"
- lambdapi
- learn-ocaml
- letsencrypt
- letters
- libsail
-
linol
>= "0.2"
- linol-eio
- linol-lwt
-
lockfree
>= "0.3.1"
-
logs-async-reporter
>= "1.3"
- lsp
-
melange-json
= "1.2.0"
- melange-json-native
-
merlin
= "3.8.0" | >= "4.6-412"
- metadb
- mirage-crypto-ec
- mjson
- monorobot
- mopsa
-
morbig
>= "0.11.0"
- multicore-bench
-
mutaml
>= "0.2"
- nloge
- nsq
- obuilder
- ocaml-lsp-server
-
ocaml-protoc-plugin
>= "6.1.0"
- ocaml_db_model
- ocaml_pgsql_model
-
ocamleditor
>= "1.15.2-ocaml414"
- ocf
- ocsigen-start
-
odoc
>= "2.0.0" & < "2.1.1" | >= "2.3.0"
- odoc-driver
- oframl
- oidc
- ojs-base
- ojs_base
-
ometrics
< "0.2.0"
- openai-gym
-
openapi
< "1.0.0"
- openapi_router
- openstellina
-
opium
>= "0.19.0"
- oraft
- orun
- osh
- ozulip
- pa_ppx
- pandoc
- pbrt_yojson
-
pds-reachability
>= "0.2.3"
- petr4
-
phylogenetics
>= "0.2.0"
- piece_rope
-
pkcs11-driver
>= "1.0.0"
- ppx_deriving_jsonschema
- ppx_deriving_yojson
-
ppx_protocol_conv_json
< "5.0.0" | >= "5.2.1"
- ppx_yojson
-
ppx_yojson_conv
< "v0.13.0"
- ppx_yojson_conv_lib
- prof_spacetime
-
qmp
>= "0.19.0"
- quests
- r2pipe
- radare2
-
rdf
< "1.0.0"
-
records
= "0.6.0" | >= "1.0.0"
- repr-bench
-
rpclib
>= "6.0.0"
- rungen
- SZXX
- safemoney
-
sail
< "0.15"
- saturn
- saturn_lockfree
-
satyrographos
!= "0.0.2.7"
- savvy
- semver2
- serde_json
-
sihl
< "0.2.0" | >= "0.3.0~rc2"
- sihl-core
- slack
- slug
- smaws-lib
-
smtml
>= "0.2.2"
- spotify-web-api
- swagger
-
tdigest
< "2.1.0"
-
textmate-language
>= "0.3.4"
-
textrazor
>= "0.1.1"
- tezos-context-hash-irmin
- tidy_email_sendgrid
-
timedesc
< "0.8.0"
- timedesc-json
-
timere
< "0.4.0"
- u2f
- user-agent-parser
- vecosek
- vercel
- vscoq-language-server
- wasm_of_ocaml-compiler
- webauthn
- why3find
-
xapi-rrd
>= "1.9.0"
- zanuda
- zarr
Conflicts
None