Config lives in YAML, spreadsheets live in CSV. Sooner or later someone asks you for the Kubernetes inventory, the Docker Compose service list or the Ansible host vars as a spreadsheet. Here's how to get there without mangling the data.
transmute$ cat services.yaml | qf --to csv name,image,replicas web,nginx:latest,3 api,node:20,2
qf auto-detects YAML on input, takes the top-level list of objects (or a named key containing one) and emits proper CSV headers. Nested maps are flattened with dot notation (resources.limits.cpu becomes its own column).
yq$ yq -o=json eval services.yaml | jq -r '(.[0] | keys_unsorted) as $cols | $cols, .[] | [.[$cols[]]] | @csv'
There's no direct YAML→CSV path in yq, so this pipes through JSON and jq. It works, but it's two tools and a cryptic filter.
import yaml, csv, sys data = yaml.safe_load(open("services.yaml")) rows = data["services"] if isinstance(data, dict) else data with open("out.csv", "w", newline="") as f: w = csv.DictWriter(f, fieldnames=rows[0].keys()) w.writeheader() w.writerows(rows)
Fine for a one-off — but note it assumes flat rows. Nested values will serialize as Python dicts unless you flatten them first.
Paste YAML into the browser converter and copy CSV out. It runs entirely client-side, so cluster names and internal hostnames never leave your machine.
Reality check: YAML can express arbitrarily deep nesting; CSV is one flat table. Ports lists, volume mounts, environment maps — each needs a decision: join into one cell (
8080|8443), repeat the parent row, or split into a second sheet. No tool makes that choice correctly for you, because it depends on what the reader wants.
Transmute runs the conversion on your machine — paste it in, or script it from the command line. JSON, YAML, CSV, TOML and XML, fully offline.
Get Transmute Desktop — $19 one-time → Or use the free web converter