aboutsummaryrefslogtreecommitdiffstats
path: root/python/markit_red.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/markit_red.py')
-rw-r--r--python/markit_red.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/python/markit_red.py b/python/markit_red.py
index 3db84c2d..60e6da8f 100644
--- a/python/markit_red.py
+++ b/python/markit_red.py
@@ -24,12 +24,15 @@ for report in ['REDEntity', 'REDObligation', 'REDEntityDelta', 'REDObligationDel
z.extract(f, path=os.path.join(root, "Tranche_data", "RED_reports"))
-fh = open("../../data/V9 Red Indices1403548976628.xml")
+basedir = os.path.join(root, "Tranche_Data", "Red")
+fh = open(os.path.join(basedir, "V9 Red Indices1403548976628.xml"))
e = etree.parse(fh)
root = e.getroot()
for c in root.findall('index'):
- with open( c.find('indexname').text + ".csv", "w") as fh2:
+ with open( os.path.join(basedir, "{0}.{1}.V{2}.csv".format(c.find('indexsubfamily').text,
+ c.find('series').text,
+ c.find('version').text)), "w") as fh2:
headers = ['referenceentity', 'redentitycode', 'role', 'redpaircode', 'jurisdiction',
'tier','pairiscurrent', 'pairvalidto', 'pairvalidfrom', 'ticker',
'ispreferred', 'isdatransactiontype', 'docclause','recorddate','publiccomments','weight']