(path: Path, rows: Iterable[Dict[str, Any]])
| 151 | |
| 152 | |
| 153 | def write_jsonl(path: Path, rows: Iterable[Dict[str, Any]]) -> None: |
| 154 | path.parent.mkdir(parents=True, exist_ok=True) |
| 155 | with path.open("w", encoding="utf-8") as handle: |
| 156 | for row in rows: |
| 157 | handle.write(json.dumps(row, ensure_ascii=False) + "\n") |
| 158 | |
| 159 | |
| 160 | def load_json(path: Path) -> Dict[str, Any]: |