!yaml.info Learn Libraries Contribute

Libraries Developers Repology

Libraries implementing YAML

YAML processors are available in many languages, some even in bash, although probably not very complete.

Because of the history of YAML the implementations differ a lot.

Library Overview

This table is work in progress. More information will be following.

Language Library Syntax Uses YAML
Test Suite
YAML
Runtimes
1.21.1
Clibfyaml()
Clibyaml~~
C#YamlDotNetn/a
C++yaml-cpp~n/an/a
HaskellHsYAMLn/a
JavaSnakeYAMLn/a~n/a
Javascriptjs-yaml~~n/a
Javascriptyaml()
PerlYAML::PP~~
Perl/XSYAML::XS (libyaml)~~n/a
PythonPyYAML~~n/a
Pythonruamel.yaml~~n/a
Rubypsychn/a~n/a

Features not implemented in every Library

libyaml and PyYAML have been implemented by Kirill Simonov in 2006. Many other implementations were ported from them or use libyaml bindings.

There were a number of features where the author diverged from the spec.

While that might have been a good idea, the YAML Spec itself did not follow that, and so some libraries support features, while implementations originating from libyaml do not.

This is a (still very incomplete) list of features that you should avoid to be compatible to as much libraries as pssible.

Most of them aren't relevant in the real world.

Empty Keys

---
key: value
: value2

In YAML 1.2, by default, this is basically the same as:

---
key: value
null: value2

Depending on the programming language, the key will often be converted to the empty string.

Having empty strings or null as keys is rare, and if you need them, you should explicitly write what you want:

---
key: value
null: value2
---
key: value
'': value2

Allowed characters in Aliases/Anchors

The spec says that pretty much every character is allowed:

- &😁 unicode anchor
- &:@*!$"<foo> WTF?

libyaml originated libraries usually only support [A-Za-z0-9-]:

- &Valid-anchor1 simple

Page Source