PythonizeYAML
Tutorial
API
GitHub
  • English
  • 简体中文
Tutorial
API
GitHub
  • English
  • 简体中文
  • API Reference

    • API reference
    • Loading and dumping
    • Documents and style editing
    • Pydantic integration
    • Configuration, styles, and tagged values
    • Errors

API reference

PythonizeYAML exposes one PyYAML-compatible API. load() and load_all() return style-aware Document objects that also behave like the ordinary dict and list values they wrap, and dump() and dump_all() accept those documents directly. Style editing is layered on the same objects.

The reference is organized as follows:

  • Loading and dumping – the module-level functions and the YAML / SafeYAML engines, with full signatures and per-argument descriptions.
  • Documents and style editing – the Document class and its members, the DocumentMapping / DocumentSequence / DocumentScalar subclasses, the styling API on values, Comments, and DocumentStream.
  • Pydantic integration – YAMLModel and YAMLSettings with byte-for-byte YAML round trips through validation.
  • Configuration, styles, and tagged values – IndentConfig, DEFAULT_CONFIG, the style enums, SourceSpan, and Tagged.
  • Errors – the YAMLError hierarchy and when each exception is raised.

If you are new to the package, start with the Tutorial and return here for exact signatures.

Last Updated: 10/3/26, 3:52 PM
Contributors: originalFactor
Next
Loading and dumping