Software
py-yaml12

py-yaml12

A modern YAML 1.2 parser and emitter for Python, written in Rust

A YAML 1.2 parser/formatter for Python, implemented in Rust for speed and correctness. Built on the excellent saphyr crate.

For almost every use case, yaml12 lets you work with plain builtin Python types end to end: dict, list, int, float, str, and None. JSON is a subset of YAML 1.2, so all valid JSON is also valid YAML and parses the same way.

  • Parse YAML text or files with parse_yaml() and read_yaml().
  • Serialize Python values with format_yaml() or write_yaml().
  • 100% compliance with the yaml-test-suite .
  • Advanced YAML features (document streams, tags, complex mapping keys) are supported and round-trip cleanly when needed. Yaml is the wrapper type for tagged nodes and unhashable mapping keys.

Contributors#

Posts about py-yaml12#