Skip to content

User guide

Loaded mappings and sequences work like Python dictionaries and lists, with the file's formatting kept alongside them, and registered classes load as their own objects. Start with reading and writing YAML if you have not used yamluna before.

Common tasks

I want to… Guide
Save and load my own classes Custom classes
Store types I do not own, such as ndarray or Decimal Custom classes
Update a string, file, or multi-document stream Read and write YAML
Add comments or move entries with their comments Comments
Keep quotes or write multiline text Strings and numbers
Use shared values and defaults Anchors and merges
Choose indentation or document markers Settings
Report invalid YAML Handle errors
Copy a practical recipe Examples
Check current edge cases Known limitations

Choosing and switching

For method signatures, use the API reference.