aboutsummaryrefslogtreecommitdiffstats
path: root/python/load_intex_collateral.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/load_intex_collateral.py')
-rw-r--r--python/load_intex_collateral.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/python/load_intex_collateral.py b/python/load_intex_collateral.py
index cf0cddac..376d81c5 100644
--- a/python/load_intex_collateral.py
+++ b/python/load_intex_collateral.py
@@ -8,6 +8,7 @@ from common import root
from db import conn, query_db
import sys
import uuid
+from load_indicative import upload_cusip_data, upload_deal_data
fields = ['Asset Name', 'Issuer', 'Contributed Balance', 'Maturity Date', \
'Asset Subtype', 'Asset Type', 'Gross Coupon', 'Spread', \
@@ -142,6 +143,17 @@ if __name__ == "__main__":
else:
dealnames = [re.sub("_AD.txt", "", d).lower() for d in
os.listdir(os.path.join(root, "data", "Collaterals_" + workdate))]
+ files = [os.path.join(root, "data", "Indicative_" + workdate, f) for f in
+ os.listdir(os.path.join(root, "data", "Indicative_" + workdate))]
+ cusip_files = [f for f in files if "TrInfo" in f]
+ deal_files = [f for f in files if "TrInfo" not in f]
+ #first load deal data
+ for deal in deal_files:
+ upload_deal_data(deal)
+ #then load tranche data
+ for cusip in cusip_files:
+ upload_cusip_data(cusip)
upload_data(conn, dealnames, workdate)
+
conn.close()
print("done")