(path: Path, rows: List[Dict[str, Any]])
| 354 | |
| 355 | |
| 356 | def write_csv(path: Path, rows: List[Dict[str, Any]]) -> None: |
| 357 | path.parent.mkdir(parents=True, exist_ok=True) |
| 358 | fields = list(rows[0].keys()) if rows else [] |
| 359 | with path.open("w", encoding="utf-8-sig", newline="") as handle: |
| 360 | writer = csv.DictWriter(handle, fieldnames=fields) |
| 361 | writer.writeheader() |
| 362 | writer.writerows(rows) |
| 363 | |
| 364 | |
| 365 | def write_guidelines(path: Path) -> None: |