modest improvement to cropping (safer)

This commit is contained in:
2026-09-15 15:13:41 +02:00
parent 9b22a8a137
commit 5b8215e7f5
6 changed files with 56 additions and 9 deletions
+2 -1
View File
@@ -110,7 +110,8 @@ def main() -> None:
flush=True)
(args.output/'report.json').write_text(json.dumps(rows, indent=2)+'\n')
with (args.output/'report.csv').open('w') as stream:
writer = csv.DictWriter(stream, fieldnames=list(rows[0]))
fieldnames = list(dict.fromkeys(key for row in rows for key in row))
writer = csv.DictWriter(stream, fieldnames=fieldnames)
writer.writeheader()
writer.writerows(rows)
cards = []