aboutsummaryrefslogtreecommitdiffstats
path: root/python/collateral/baml_isda.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/collateral/baml_isda.py')
-rw-r--r--python/collateral/baml_isda.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/python/collateral/baml_isda.py b/python/collateral/baml_isda.py
index b53cdaa6..ba42ec81 100644
--- a/python/collateral/baml_isda.py
+++ b/python/collateral/baml_isda.py
@@ -63,7 +63,10 @@ def download_files(d=None, count=20):
em = ExchangeMessage()
emails = em.get_msgs(path=["NYops", "Margin Calls Baml"], count=count)
for msg in emails:
- if msg.sender.name == "us_otc_client_valuation@baml.com":
+ if (
+ msg.sender.name == "us_otc_client_valuation@baml.com"
+ or msg.sender.name == "us_otc_client_valuation@bofa.com"
+ ):
soup = BeautifulSoup(msg.body, features="lxml")
a = soup.find("a")
url = urlsplit(a["href"])
@@ -113,7 +116,10 @@ def collateral(d, dawn_trades, *args):
raise ValueError("no data for date {d}")
df = pd.read_excel(fname, skiprows=6, skipfooter=6)
df = df.drop(0, axis=0)
- collateral = float(df.Notional)
+ try:
+ collateral = float(df.Notional)
+ except TypeError:
+ collateral = df.Notional.sum()
d -= BDay()
fname = REPORTS_DIR / f"Interest Rates Trade Summary_{d:%d-%b-%Y}.xls"
# TODO: make more robust