aboutsummaryrefslogtreecommitdiffstats
path: root/python/intex/load_intex_collateral.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/intex/load_intex_collateral.py')
-rw-r--r--python/intex/load_intex_collateral.py12
1 files changed, 5 insertions, 7 deletions
diff --git a/python/intex/load_intex_collateral.py b/python/intex/load_intex_collateral.py
index e43a58b1..2e8bad22 100644
--- a/python/intex/load_intex_collateral.py
+++ b/python/intex/load_intex_collateral.py
@@ -1,10 +1,8 @@
+import csv
+import datetime
import psycopg2
-import os, csv, datetime
-import pdb
from common import sanitize_float
-from . import dbconn
-from pathlib import Path
-import sys
+from serenitas.utils.env import DATA_DIR
import uuid
from .load_indicative import upload_cusip_data, upload_deal_data
import logging
@@ -76,7 +74,7 @@ def upload_data(conn, workdate):
sqlstr = "INSERT INTO ET_COLLATERAL({0}) VALUES({1})".format(
",".join(sql_fields), ",".join(["%s"] * len(sql_fields))
)
- basedir = Path(os.environ["DATA_DIR"]) / ("Collaterals_" + workdate)
+ basedir = DATA_DIR / ("Collaterals_" + workdate)
for fname in basedir.iterdir():
if fname.stem.endswith("zip"):
continue
@@ -214,7 +212,7 @@ def upload_data(conn, workdate):
def intex_data(conn, workdate):
- basedir = Path(os.environ["DATA_DIR"]) / ("Indicative_" + workdate)
+ basedir = DATA_DIR / ("Indicative_" + workdate)
cusip_files = [f for f in basedir.iterdir() if "TrInfo" in f.name]
deal_files = [f for f in basedir.iterdir() if "TrInfo" not in f.name]
# first load deal data