json-tools .ru

Python dict to YAML

Parses a Python structure and outputs the same data as YAML — useful when a dict hardcoded in a script needs to move into a config file.

Types during conversion

True/False/None become unquoted YAML true/false/null, and both tuple and set render as a plain YAML list — YAML, like JSON, doesn't distinguish between those three collection types.

Odoo/debug repr

Values like <Command.SET: 6> or datetime.date(2024, 1, 5) from debug output become plain strings ("Command.SET: 6", "2024-01-05") that a YAML parser can read back without errors.

Format
Python → YAML
Source text Paste text or upload a file
Result Type is not detected yet
Statistics appear after formatting