Yield one user dict per row from the source users.json wrapper.
(source_dir: Path)
| 347 | |
| 348 | |
| 349 | def user_rows(source_dir: Path): |
| 350 | """Yield one user dict per row from the source users.json wrapper.""" |
| 351 | src = source_dir / "users.json" |
| 352 | if not src.exists(): |
| 353 | return |
| 354 | with src.open("r", encoding="utf-8") as handle: |
| 355 | payload = json.load(handle) |
| 356 | for user in payload.get("users") or []: |
| 357 | yield user |
| 358 | |
| 359 | |
| 360 | def prepare(source_dir: Path, output_dir: Path, clean: bool = True) -> None: |