package yojson
Install
Dune Dependency
Authors
Maintainers
Sources
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 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
>= "1.3.2"
- archetype
-
atd
>= "2.6.0"
-
atdgen
< "1.9.0" | >= "1.13.0" & < "2.8.0" | >= "2.10.0"
-
atdgen-runtime
>= "2.10.0"
- avro-compiler
-
aws
< "1.0.0"
- aws-config
-
aws-s3
>= "1.1.0" & < "4.5.1" | >= "4.8.0"
- awsm-codegen
- bap-radare2
-
beluga
>= "1.1"
-
bitcoin
>= "3.0"
- boulangerie
- caisar
-
calculon
!= "0.5"
- calculon-redis-lib
-
camelot
>= "1.3.0"
- camels
- canary
-
catala
= "0.9.0"
- cb-check
-
cbor
!= "0.2"
- cconv-ppx
- colibrics
- comby-semantic
- commons
-
containers
>= "3.9"
- coq-lsp
- coq-of-ocaml
-
coq-serapi
>= "8.10.0+0.7.0"
- current_docker
-
current_examples
>= "0.4"
- current_git
- current_github
- current_gitlab
- current_slack
- current_ssh
-
current_web
>= "0.4"
- cwe_checker
- dap
-
datakit-ci
>= "0.12.3"
- daypack-lib
-
decoders-yojson
>= "0.7.0"
- deriving-yojson
-
devkit
>= "0.4"
-
docfd
>= "2.1.0"
-
docker-api
>= "0.2.2"
- docker_hub
-
dot-merlin-reader
!= "4.4~5.0.preview" & < "4.6"
- dream
-
dune-release
>= "1.4.0"
-
earlybird
< "1.0.0"
-
eio_main
>= "0.10"
-
facebook-sdk
< "0.3.1"
- fiat-p256
-
fit
>= "1.2.0"
-
forester
>= "3.1.0"
-
frama-c
>= "19.0" & < "23.0" | >= "27.0~beta"
- fred
-
frenetic
>= "3.2.0"
-
fstar
>= "0.9.3.0-beta1"
-
gapi-ocaml
< "0.3.5" | >= "0.4.3"
-
gdbprofiler
>= "0.2"
- gemini
-
gen-bs
>= "0.1.0"
-
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
- iocaml
- iocaml-kernel
- ip2location
- ip2locationio
- ip2whois
-
irmin-bench
< "3.0.0"
-
irmin-graphql
>= "2.2.0"
- irmin-tezos
- jasmin
- jhupllib
- jose
- js_of_ocaml-compiler
- json-pointer
- json-predicate
-
jsonrpc
< "1.6.0"
- jsonschema2atd
- jupyter
- jupyter-kernel
- jwto
- kappa-library
- karamel
- ketrew
- kind2
-
kremlin
< "transition"
- kubecaml
-
lablgtk3-extras
>= "3.0.1"
- lablqt
-
lambdapi
>= "2.0.0"
- learn-ocaml
- letsencrypt
- letters
- libsail
-
linol
>= "0.2"
- linol-eio
- linol-lwt
-
lockfree
>= "0.3.0"
-
logs-async-reporter
>= "1.3"
- lsp
-
melange-json
>= "1.2.0"
-
merlin
= "3.0.3" | = "3.8.0" | >= "4.6-412"
- merlin-acme
- metadb
- mezzo
-
minimal
>= "1.1.0"
- mirage-crypto-ec
- mjson
- monorobot
- mopsa
-
morbig
>= "0.11.0"
- multicore-bench
- netml
- nloge
-
nsq
>= "0.2.4"
- obuilder
- ocaml-gist
- ocaml-lsp-server
-
ocaml-protoc-plugin
>= "6.1.0"
- ocaml-webworker
- ocaml_db_model
- ocaml_pgsql_model
-
ocamleditor
>= "1.15.2-ocaml414"
- ocf
-
oclaunch
< "0.2.1"
- ocsigen-start
-
odoc
>= "2.0.0" & < "2.1.1" | >= "2.3.0"
- oframl
-
ogen
= "0.1.2"
- oidc
-
ojs-base
!= "0.2.0"
- ojs_base
-
ometrics
< "0.2.0"
-
opam2web
>= "2.0"
- openai-gym
- openapi
- 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"
-
plist
>= "1.0.0"
-
podge
>= "0.4"
-
ppx_deriving_protocol
< "0.8.1"
-
ppx_deriving_yojson
>= "3.4"
- ppx_graphql
- ppx_json_types
-
ppx_protocol_conv
= "2.0.0"
-
ppx_protocol_conv_json
= "3.1.3" | >= "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
>= "0.9.0"
-
records
= "0.6.0" | >= "1.0.0"
- repr-bench
-
rpc
= "2.2.0"
-
rpclib
>= "6.0.0"
- rubytt
- rungen
- SZXX
- safemoney
-
sail
< "0.15"
- saturn
- saturn_lockfree
-
satyrographos
!= "0.0.2.7"
- semver2
- serde_json
-
sihl
< "0.2.0" | >= "0.3.0~rc2"
- sihl-core
- slack
-
slacko
< "0.14.1"
- slug
-
smtml
>= "0.2.2"
- sparrow
- sphinxcontrib-ocaml
- spotify-web-api
- starred_ml
- swagger
-
tdigest
< "2.1.0"
-
telegraml
< "2.2.0"
- testrunner
-
textmate-language
>= "0.3.4"
-
textrazor
>= "0.1.1"
- tezos-context-hash-irmin
- themoviedb
- tidy_email_sendgrid
-
timedesc
< "0.8.0"
- timedesc-json
-
timere
< "0.4.0"
- transmission-rpc
- u2f
- usbmux
- user-agent-parser
- vecosek
- vercel
- vscoq-language-server
- webauthn
- why3find
-
xapi-rrd
>= "1.9.0"
-
yojson-five
>= "2.2.2"
- yosqlite
- zanuda
Conflicts
None