aboutsummaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rw-r--r--python/download_scotia.py7
-rw-r--r--python/report_ops/cash.py9
-rw-r--r--python/report_ops/custodians.py7
3 files changed, 16 insertions, 7 deletions
diff --git a/python/download_scotia.py b/python/download_scotia.py
index 05d0829d..e7c3aafb 100644
--- a/python/download_scotia.py
+++ b/python/download_scotia.py
@@ -4,7 +4,6 @@ from selenium import webdriver
from selenium.webdriver.firefox.options import Options
from selenium.webdriver.support.ui import WebDriverWait
from report_ops.logger import get_logger
-import sys
from serenitas.utils.env import DAILY_DIR
@@ -71,12 +70,8 @@ def create_driver(download_dir):
return webdriver.Firefox(firefox_profile=fp, options=options)
-def main():
+def download_scotia_report():
scotia_login = {"selene-ops@lmcg.com": "oeujG*UF!53o"}
for username, password in scotia_login.items():
REPORT_DIR = DAILY_DIR / "Selene" / "Scotia_reports"
download_report(username, password, REPORT_DIR)
-
-
-if __name__ == "__main__":
- main()
diff --git a/python/report_ops/cash.py b/python/report_ops/cash.py
index 79e4a8b0..1860959b 100644
--- a/python/report_ops/cash.py
+++ b/python/report_ops/cash.py
@@ -4,7 +4,7 @@ import pandas as pd
from serenitas.utils.db import dbconn
from typing import ClassVar
from .misc import get_dir, dt_from_fname
-from .custodians import NT, UMB, BNY
+from .custodians import NT, UMB, BNY, SCOTIA
from functools import partial
from dataclasses import dataclass
@@ -123,3 +123,10 @@ class BowdstBNYCashReport(
self.stage_from_row(row)
self.commit()
self._staging_queue.clear()
+
+
+class SeleneScotiaCashReport(
+ CashReport, SCOTIA, fund="ISOSEL", custodian="SCOTIA", dtkey="%Y%m%d%H%M%S"
+):
+ def to_db(self):
+ p = self.download_reports()
diff --git a/python/report_ops/custodians.py b/python/report_ops/custodians.py
index 7c28bcf7..2c985225 100644
--- a/python/report_ops/custodians.py
+++ b/python/report_ops/custodians.py
@@ -3,6 +3,7 @@ from serenitas.utils.env import DAILY_DIR
import warnings
import datetime
from .misc import get_dir, _recipients, _cc_recipients
+from .scotia import download_scotia_report
import gpg
from serenitas.ops.trade_dataclasses import BondDeal
from serenitas.ops.funds import Service
@@ -194,3 +195,9 @@ class BNY(Custodian, account="BONY2"):
p.parent.mkdir(parents=True, exist_ok=True)
if not p.exists():
p.write_bytes(attach.content)
+
+
+class SCOTIA(Custodian, account="SCOTIA"):
+ @staticmethod
+ def download_reports(date=datetime.date.today()):
+ download_scotia_report()