OCaml Library Collection
/

Yamlrw is a pure OCaml implementation of YAML 1.2 parsing and emission.

Getting Started

See the Tutorial for an introduction to YAML and the library.

API Reference

Installation

Install with opam:

opam install yamlrw

For Unix file I/O:

opam install yamlrw-unix

For Eio async support (OCaml 5.0+):

opam install yamlrw-eio

Quick Example

open Yamlrw

(* Parse YAML *)
let config = of_string {|
server:
  host: localhost
  port: 8080
|}

(* Access values *)
let host = Util.(get_string (get "host" (get "server" config)))

(* Serialize to YAML *)
let yaml_string = to_string config