(path: Path, rows: Iterable[Dict[str, Any]])
| 82 | |
| 83 | |
| 84 | def write_jsonl(path: Path, rows: Iterable[Dict[str, Any]]) -> None: |
| 85 | path.parent.mkdir(parents=True, exist_ok=True) |
| 86 | with path.open("w", encoding="utf-8") as handle: |
| 87 | for row in rows: |
| 88 | handle.write(json.dumps(row, ensure_ascii=False) + "\n") |
| 89 | |
| 90 | |
| 91 | def load_json(path: Path) -> Dict[str, Any]: |