Nested YAML mapping
Input
title: My App
owner:
name: Ada
age: 36Output
title = "My App"
[owner]
name = "Ada"
age = 36The indented mapping becomes an [owner] table header.
Both YAML and TOML are human-written config formats, and this conversion is usually part of a deliberate migration, moving a project onto pyproject.toml, or adopting TOML because its parsing rules are less surprising than YAML's implicit typing.
YAML is the more expressive of the two, so this direction is where things get dropped: comments, anchors, multiple documents and null values all have no TOML equivalent.
Each example below is executed against this tool by the test suite, so what you see is what the tool actually produces.
Input
title: My App
owner:
name: Ada
age: 36Output
title = "My App"
[owner]
name = "Ada"
age = 36The indented mapping becomes an [owner] table header.
The details that decide whether a conversion is correct, and where information can be lost without any error being raised.
Turn a TOML config into indented YAML.
Turn JSON into TOML for Cargo, pyproject and similar config files.
Turn a single YAML document into JSON, with limits on what carries over.
Turn JSON into readable YAML for config files and manifests.