Download src/utils/file_utils.py from techprotrade/annator: direct link, hf CLI and curl.
- Browser
- Download file 367 Bytes
-
https://huggingface.co/techprotrade/annator/resolve/fb26dc8decbf6fbcdf145aa5f9debd7eca5cae35/src/utils/file_utils.py
- Command line
-
hf download hf://techprotrade/annator@fb26dc8decbf6fbcdf145aa5f9debd7eca5cae35/src/utils/file_utils.py
-
curl -L -o file_utils.py https://huggingface.co/techprotrade/annator/resolve/fb26dc8decbf6fbcdf145aa5f9debd7eca5cae35/src/utils/file_utils.py
367 Bytes
| 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}" | |