From 96c503a106d9bcd06b1cbce4726aeeab5194b9ec Mon Sep 17 00:00:00 2001 From: Bradlee Speice Date: Fri, 19 Aug 2016 22:09:18 -0400 Subject: [PATCH] str -> bytes fixes --- metrik/tasks/nasdaq.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/metrik/tasks/nasdaq.py b/metrik/tasks/nasdaq.py index 828c544..f00eabe 100644 --- a/metrik/tasks/nasdaq.py +++ b/metrik/tasks/nasdaq.py @@ -1,6 +1,6 @@ import requests import pandas as pd -from six import StringIO +from six import BytesIO from metrik.tasks.base import MongoNoBackCreateTask @@ -15,7 +15,7 @@ class NasdaqCompanyList(MongoNoBackCreateTask): csv_bytes = requests.get('http://www.nasdaq.com/screening/' 'companies-by-region.aspx?&render=download') \ .content - csv_filelike = StringIO(csv_bytes) + csv_filelike = BytesIO(csv_bytes) company_csv = pd.read_csv(csv_filelike)[ ['Symbol', 'Name', 'LastSale', 'MarketCap', 'Country', 'IPOyear', 'Sector', 'Industry'] @@ -32,6 +32,6 @@ class NasdaqETFList(MongoNoBackCreateTask): csv_bytes = requests.get('http://www.nasdaq.com/investing/etfs/' 'etf-finder-results.aspx?download=Yes') \ .content - csv_filelike = StringIO(csv_bytes) + csv_filelike = BytesIO(csv_bytes) etf_csv = pd.read_csv(csv_filelike)[['Symbol', 'Name', 'LastSale']] return {'etfs': etf_csv.to_dict(orient='records')}