diff options
Diffstat (limited to 'python/citco_ops/misc.py')
| -rw-r--r-- | python/citco_ops/misc.py | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/python/citco_ops/misc.py b/python/citco_ops/misc.py deleted file mode 100644 index 318bb4eb..00000000 --- a/python/citco_ops/misc.py +++ /dev/null @@ -1,22 +0,0 @@ -import pathlib -import datetime -from serenitas.utils.env import DAILY_DIR - - -def get_dir(workdate: datetime.date, archived=True) -> pathlib.Path: - p = DAILY_DIR / str(workdate) / "Reports" - if not p.exists() and archived: - p = ( - DAILY_DIR - / str(workdate.year) - / f"{workdate:%Y_%m}" - / str(workdate) - / "Reports" - ) - return p - - -def dt_from_fname(f): - return datetime.datetime.strptime( - f.name.removesuffix(".csv").removesuffix(".xlsx").rsplit("_")[-1], "%Y%m%d%H%M" - ) |
