diff options
| -rw-r--r-- | python/markit/cds.py | 4 | ||||
| -rw-r--r-- | python/markit/rates.py | 4 | ||||
| -rw-r--r-- | python/markit_red.py | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/python/markit/cds.py b/python/markit/cds.py index 5fbc2d3a..8a7892e8 100644 --- a/python/markit/cds.py +++ b/python/markit/cds.py @@ -15,7 +15,7 @@ def convertToNone(v): def download_cds_data(payload):
- r = requests.get('https://www.markit.com/export.jsp', params=payload)
+ r = requests.post('https://www.markit.com/export.jsp', params=payload)
f2 = open(os.path.join(os.environ['BASE_DIR'], "Tranche_data", "CDS",
"cds eod {0}.csv".format(payload['date'])), "wb")
with zipfile.ZipFile(io.BytesIO(r.content)) as z:
@@ -37,7 +37,7 @@ def download_composite_data(payload, historical=False): for family in ['CDX', 'ITRAXX-EUROPE']:
payload.update({'family': family, 'report': report})
while True:
- r = requests.get('https://www.markit.com/export.jsp', params=payload)
+ r = requests.post('https://www.markit.com/export.jsp', params=payload)
try:
with zipfile.ZipFile(io.BytesIO(r.content)) as z:
for f in z.namelist():
diff --git a/python/markit/rates.py b/python/markit/rates.py index e3bd6469..051e3ec0 100644 --- a/python/markit/rates.py +++ b/python/markit/rates.py @@ -19,10 +19,10 @@ def downloadMarkitIRData(download_date=datetime.date.today(), basedir = os.path.join(os.environ['DATA_DIR'], "Yield Curves") filename = f"InterestRates_{currency}_{effective_date:%Y%m%d}" if not os.path.exists(os.path.join(basedir, filename + '.xml')): - r = requests.get(f'http://www.markit.com/news/{filename}.zip') + r = requests.post(f'http://www.markit.com/news/{filename}.zip') if "zip" in r.headers['content-type']: with zipfile.ZipFile(BytesIO(r.content)) as z: - z.extractall(path = os.path.join(os.environ['DATA_DIR'], "Yield Curves")) + z.extractall(path=os.path.join(os.environ['DATA_DIR'], "Yield Curves")) else: return downloadMarkitIRData(download_date - datetime.timedelta(days=1)) diff --git a/python/markit_red.py b/python/markit_red.py index 6da0ffb8..1427ed1b 100644 --- a/python/markit_red.py +++ b/python/markit_red.py @@ -10,7 +10,7 @@ from db import with_connection, dbengine import pandas as pd def request_payload(payload): - r = requests.get('https://www.markit.com/export.jsp', params=payload) + r = requests.post('https://www.markit.com/export.jsp', params=payload) res = [] path = os.path.join(os.environ['BASE_DIR'], "Tranche_data", "RED_reports") if 'Delta' in payload['report']: |
