(path: Path, rows: Iterable[Dict[str, Any]])
| 177 | |
| 178 | |
| 179 | def write_jsonl(path: Path, rows: Iterable[Dict[str, Any]]) -> None: |
| 180 | path.parent.mkdir(parents=True, exist_ok=True) |
| 181 | with path.open("w", encoding="utf-8") as handle: |
| 182 | for row in rows: |
| 183 | handle.write(json.dumps(row, ensure_ascii=False) + "\n") |
| 184 | |
| 185 | |
| 186 | def load_json(path: Path) -> Dict[str, Any]: |