(path: Path, rows: List[Dict[str, Any]])
| 202 | |
| 203 | |
| 204 | def write_csv(path: Path, rows: List[Dict[str, Any]]) -> None: |
| 205 | path.parent.mkdir(parents=True, exist_ok=True) |
| 206 | fields = list(rows[0].keys()) if rows else [] |
| 207 | with path.open("w", encoding="utf-8-sig", newline="") as handle: |
| 208 | writer = csv.DictWriter(handle, fieldnames=fields) |
| 209 | writer.writeheader() |
| 210 | writer.writerows(rows) |
| 211 | |
| 212 | |
| 213 | def write_guidelines(path: Path) -> None: |