YAML is popular for configuration because it is compact and easy to scan. Converting a Python dictionary to YAML is useful when drafting a settings file, documenting an example or checking how nested data will look outside your application.
The dictionary {'database': {'host': 'localhost', 'port': 5432}, 'debug': False} becomes a short, nested YAML document. Booleans remain readable as true or false, and dictionaries become indented blocks.
This converter is designed for everyday dictionaries, lists, strings, numbers, booleans and null values. Custom Python classes, functions and complex objects are not portable configuration values and should be converted to plain data first.
Learn when YAML is a better fit in our YAML vs JSON comparison, or convert YAML back with YAML to Python.