The converter parses Python dict data locally and serializes the parsed values as YAML. Curly-brace dictionaries and dict() constructor input become YAML mappings, lists and tuples become sequences, and None, True, and False are mapped into YAML-compatible scalar values.
It supports literal syntax such as curly-brace dicts, dict() constructor syntax, tuples, inline comments, and numeric forms like 0xFF or 1_000. It does not evaluate variables, imports, comprehensions, or function calls, and YAML output will not preserve original comments or quote style.
Common questions and answers about this topic.
A Python dictionary is a data structure defined using curly braces with key-value pairs (e.g., {'key': 'value'}), supporting Python-specific types like None and tuples. YAML is a human-readable serialization format that uses indentation to represent structure, commonly used for configuration files in tools like Ansible, Docker Compose, and Kubernetes.
The converter supports standard Python dict literals, dict() constructor syntax, single-quoted and double-quoted strings, numeric keys and values, None, True, False, nested dictionaries, lists, tuples, inline comments, and common numeric literal formats. It parses supported Python literal syntax directly, so your input should be a valid Python dict expression.
Yes, the sort keys dropdown lets you arrange all YAML mapping keys alphabetically (A to Z) or keep the original key order from your Python dictionary. Sorting is applied recursively through all nested mappings.
Choose 2, 3, 4, or 8 spaces from the output formatting controls. The converter formats nested mappings and sequences consistently after parsing your Python dictionary.
No, the Python dict to YAML conversion runs entirely in your browser. Your Python dictionary data is processed locally with JavaScript and never sent to any server.