Developer Tool

Python Dict to YAML

Paste a Python dictionary below to inspect readable YAML. Conversion runs in your browser.
Python
Output (YAML)
// Your YAML will appear here...
As conversões são processadas diretamente no seu navegador.

Create readable YAML from a Python dictionary

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.

What makes good YAML

Example

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.

Limitations

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.

Copied to clipboard