(path: Path, rows: List[Dict[str, Any]])
| 232 | |
| 233 | |
| 234 | def write_csv(path: Path, rows: List[Dict[str, Any]]) -> None: |
| 235 | path.parent.mkdir(parents=True, exist_ok=True) |
| 236 | fields = list(rows[0].keys()) if rows else [] |
| 237 | with path.open("w", encoding="utf-8-sig", newline="") as handle: |
| 238 | writer = csv.DictWriter(handle, fieldnames=fields) |
| 239 | writer.writeheader() |
| 240 | writer.writerows(rows) |
| 241 | |
| 242 | |
| 243 | def write_guidelines(path: Path) -> None: |