aboutsummaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rw-r--r--python/monthend_interest_recon.py20
1 files changed, 19 insertions, 1 deletions
diff --git a/python/monthend_interest_recon.py b/python/monthend_interest_recon.py
index 7192d8b7..4a45fd8b 100644
--- a/python/monthend_interest_recon.py
+++ b/python/monthend_interest_recon.py
@@ -191,4 +191,22 @@ if __name__ == "__main__":
df = export_data(start, end)
for k, v in interest_recon["difference"].items():
df.loc[k].loc["CSH_CASH"] -= v
- df.to_csv("/home/serenitas/flint/interest_recon.csv")
+ from io import StringIO
+ from serenitas.utils.exchange import ExchangeMessage, FileAttachment
+
+ buf = StringIO()
+ df.to_csv(buf)
+ attach = [
+ FileAttachment(
+ name=f"{start:%b}.csv",
+ content=buf.getvalue().encode(),
+ )
+ ]
+ em = ExchangeMessage()
+ em.send_email(
+ subject=f"Allocation of Interest for {start:%b}",
+ body="Please see attached",
+ to_recipients=("serenitas.otc@sscinc.com", "SERENITAS.ops@sscinc.com"),
+ cc_recipients=("nyops@lmcg.com",),
+ attach=attach,
+ )