diff options
Diffstat (limited to 'python/markit_tranche_quotes.py')
| -rw-r--r-- | python/markit_tranche_quotes.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/python/markit_tranche_quotes.py b/python/markit_tranche_quotes.py index 8bad859a..ef209b02 100644 --- a/python/markit_tranche_quotes.py +++ b/python/markit_tranche_quotes.py @@ -16,8 +16,6 @@ params = { r = requests.post("https://quotes.markit.com/reports/runReport", params=params) f = io.StringIO(r.text) -with open("quotes.csv", "w") as fh: - fh.write(r.text) index_mapping = { "ITRAXX-Europe": "EU", @@ -52,6 +50,7 @@ markit_id = get_latest_quote_id(serenitasdb) headers = [h.lower() for h in next(f).strip().split(",")] count = 0 + for d in csv.DictReader(f, fieldnames=headers): d["quotedate"] = datetime.datetime.strptime(d["time"], "%m/%d/%Y %H:%M:%S") d["quotedate"] = d["quotedate"].replace(tzinfo=pytz.UTC) |
