(path: Path, rows: Iterable[Dict[str, Any]])
| 55 | |
| 56 | |
| 57 | def write_jsonl(path: Path, rows: Iterable[Dict[str, Any]]) -> None: |
| 58 | path.parent.mkdir(parents=True, exist_ok=True) |
| 59 | with path.open("w", encoding="utf-8") as handle: |
| 60 | for row in rows: |
| 61 | handle.write(json.dumps(row, ensure_ascii=False) + "\n") |
| 62 | |
| 63 | |
| 64 | def load_json(path: Path) -> Dict[str, Any]: |