dumbyaml

raw JSON →
0.9.3 verified Fri May 01 auth: no python

A restricted YAML parser that reads only a safe subset of YAML, designed for use with config files where you want to avoid arbitrary YAML features. Version 0.9.3 is current. Release cadence is low, with occasional updates.

pip install dumbyaml
error dumbyaml.exceptions.DumpyError: Unexpected end of stream
cause Malformed YAML (e.g., missing closing quote or colon)
fix
Check your YAML syntax. dumbyaml is strict; trailing spaces or indentation errors also cause this.
error dumbyaml.exceptions.DumpyError: Unsupported YAML construct
cause Using a YAML feature not in the restricted subset (e.g., anchors, tags like !!python/object)
fix
Remove unsupported constructs. Stick to basic mappings, sequences, and scalars.
gotcha dumbyaml does NOT support full YAML 1.1; it only accepts a restricted subset (scalars, mappings, sequences, basic tags). Do not expect anchors, aliases, or complex types to work.
fix Use only simple YAML constructs: strings, numbers, lists, dicts.
breaking dumbyaml's load returns only primitive Python types (str, int, float, bool, None, list, dict). It will never return arbitrary Python objects, unlike PyYAML's FullLoader
fix If you need custom objects, serialize them manually.

Load a simple YAML string.

from dumbyaml import load

yaml_str = """
name: test
version: 1
"""
data = load(yaml_str)
print(data['name'])  # test