aboutsummaryrefslogtreecommitdiffstats
path: root/python/position_file_bowdst.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/position_file_bowdst.py')
-rw-r--r--python/position_file_bowdst.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/python/position_file_bowdst.py b/python/position_file_bowdst.py
index 8ee1e154..3fcc1d7d 100644
--- a/python/position_file_bowdst.py
+++ b/python/position_file_bowdst.py
@@ -3,21 +3,23 @@ import argparse
from serenitas.utils.remote import Client
from serenitas.utils.exchange import ExchangeMessage, FileAttachment
from report_ops.misc import _recipients, _cc_recipients
+import datetime
+from serenitas.analytics.dates import prev_business_day
def main(cob, fund, upload):
buf, dest = build_position_file(
- cob, fund, ["bond", "future", "tranche", "irswaption", "cdxswaption"]
+ cob, fund, ["bond", "future", "tranche", "ir_swaption", "cdx_swaption"]
)
if upload:
client = Client.from_creds("hm_globeop")
- cls.client.put(buf, dest.name)
+ client.put(buf, dest.name)
em = ExchangeMessage()
em.send_email(
subject=f"Position_files for Bowdoin Street as of {cob}",
body=f"Please see monthend positions for Bowdoin Street as of {cob}. They have been uploaded to the SFTP as well.",
- recipients=_recipients[fund],
+ to_recipients=_cc_recipients[fund],
cc_recipients=_cc_recipients[fund],
reply_to=_cc_recipients[fund],
attach=[FileAttachment(name=dest.name, content=buf)],
@@ -41,7 +43,6 @@ parser.add_argument(
help="uploads to globeop",
)
args = parser.parse_args()
-conn = dbconn("dawndb")
if (
not prev_business_day(datetime.date.today()) == args.date and not args.no_upload
): # We only want to upload if the previous business day was monthend