diff options
Diffstat (limited to 'python/report_ops/cash.py')
| -rw-r--r-- | python/report_ops/cash.py | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/python/report_ops/cash.py b/python/report_ops/cash.py index 1860959b..ddf6d180 100644 --- a/python/report_ops/cash.py +++ b/python/report_ops/cash.py @@ -8,6 +8,8 @@ from .custodians import NT, UMB, BNY, SCOTIA from functools import partial from dataclasses import dataclass +from serenitas.utils.env import DAILY_DIR + @dataclass class CashReport: @@ -129,4 +131,18 @@ class SeleneScotiaCashReport( CashReport, SCOTIA, fund="ISOSEL", custodian="SCOTIA", dtkey="%Y%m%d%H%M%S" ): def to_db(self): - p = self.download_reports() + p = self.get_cash_report() + df = pd.read_excel(p) + return + + def get_cash_report(self, prefix=None): + self.download_reports(self.date) + REPORT_DIR = DAILY_DIR / "Selene" / "Scotia_reports" + try: + return next( + REPORT_DIR.glob( + f"IsoSelene_{prev_business_day(self.date):%d-%b-%Y}_*_xlsx.JOAAPKO3.JOAAPKO1" + ) + ) + except StopIteration as e: # File doesn't exist, let's get it" + raise ValueError(f"No file available for Scotia on {self.date}") from e |
