Wiki

Clone wiki

snakeyaml / Home

Welcome

YAML 1.1 parser and emitter for Java.

Requirements

SnakeYAML requires Java 7 or higher (The latest version built for Java 6 is 1.23).

SnakeYAML does not depend on any external library (but the tests do).

Info

Quick start

Loading (de-serialize):

LoaderOptions options = new LoaderOptions();
Yaml yaml = new Yaml(options);
Object obj = yaml.load("a: 1\nb: 2\nc:\n  - aaa\n  - bbb");
System.out.println(obj);

{b=2, c=[aaa, bbb], a=1}
Dumping (serialise):
Map<String, String> map = new HashMap<String, String>();
map.put("name", "Pushkin");
Yaml yaml = new Yaml();
String output = yaml.dump(map);
System.out.println(output);

---
name: Pushkin

For more details, please check Documentation

Contribute

The SnakeYAML library is developed by the team of developers and it is based on PyYAML module written by Kirill Simonov.

SnakeYAML is released under the Apache 2.0 license.

Have fun!

Updated