File size: 367 Bytes
734b5b4
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
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}"