diff options
Diffstat (limited to 'python')
| -rw-r--r-- | python/citco_ops/cash.py | 10 | ||||
| -rw-r--r-- | python/isosel_reports.py | 3 |
2 files changed, 10 insertions, 3 deletions
diff --git a/python/citco_ops/cash.py b/python/citco_ops/cash.py index 8ed92db3..42e1f76d 100644 --- a/python/citco_ops/cash.py +++ b/python/citco_ops/cash.py @@ -42,12 +42,14 @@ class IAMDeal(Deal, deal_type=None, table_name="iam_tickets"): @dataclass class CashReport: - fund: str = "ISOSEL" + fund: str _conn: dbconn = dbconn("dawndb") + def __init_subclass__(cls, fund): + cls.fund = fund + def __init__(self, date): self.date = date - self.fund = "ISOSEL" def download_report(self): em = ExchangeMessage() @@ -95,3 +97,7 @@ class CashReport: ) self._conn.commit() df.to_sql("cash_balances", index=False, if_exists="append", con=dawn_engine) + + +class IsoselCashReport(CashReport, fund="ISOSEL"): + pass diff --git a/python/isosel_reports.py b/python/isosel_reports.py index b01cf90f..bc80f970 100644 --- a/python/isosel_reports.py +++ b/python/isosel_reports.py @@ -1,4 +1,5 @@ from citco_ops.remote import AccruedReport, AllReport +from citco_ops.cash import IsoselCashReport import datetime from serenitas.analytics.dates import prev_business_day import logging @@ -16,7 +17,7 @@ if __name__ == "__main__": help="report date", ) args = parser.parse_args() - for report_cls in AccruedReport, AllReport: + for report_cls in AccruedReport, AllReport, IsoselCashReport: report = report_cls(args.date) try: report.to_db() |
