| from __future__ import annotations | |
| from pathlib import Path | |
| from datetime import datetime | |
| def ensure_dir(path: Path) -> Path: | |
| path.mkdir(parents=True, exist_ok=True) | |
| return path | |
| def stage_file(output_dir: Path, prefix: str, suffix: str = ".pdf") -> Path: | |
| ts = datetime.now().strftime("%Y%m%d-%H%M%S-%f") | |
| return output_dir / f"{prefix}-{ts}{suffix}" | |