diff options
Diffstat (limited to 'python/load_refentity.py')
| -rw-r--r-- | python/load_refentity.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/python/load_refentity.py b/python/load_refentity.py index 2d07bf62..99c51b16 100644 --- a/python/load_refentity.py +++ b/python/load_refentity.py @@ -1,11 +1,11 @@ -from utils.db import dbconn -from pathlib import Path +from serenitas.utils.db import dbconn +from serenitas.utils.env import BASE_DIR import datetime import re import lxml.etree as etree +from psycopg2.extras import Json parser = etree.XMLParser(remove_blank_text=True) -from psycopg2.extras import Json def todict(xml, uselist=set()): @@ -185,7 +185,7 @@ def insert_refobligation(fname): def get_date(f): - m = re.search("(\d*)\.", f.name) + m = re.search(r"(\d*)\.", f.name) if m: timestamp = int(m.groups(0)[0]) return datetime.datetime.fromtimestamp(timestamp / 1000) @@ -194,7 +194,7 @@ def get_date(f): if __name__ == "__main__": from markit_red import download_report - base_dir = Path("/home/serenitas/CorpCDOs/Tranche_data/RED_reports/Deltas") + base_dir = BASE_DIR / "Tranche_data/RED_reports/Deltas" for report in ["REDEntityDelta", "REDObligationDelta"]: g = download_report(report) f = base_dir / next(g)[0] |
