Skip to content
This repository has been archived by the owner on Jun 15, 2024. It is now read-only.

Commit

Permalink
fixes #21
Browse files Browse the repository at this point in the history
  • Loading branch information
timkpaine committed Sep 11, 2018
1 parent 1c1f5c9 commit 25c795c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pyEX/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@
_LIST_OPTIONS = ['mostactive', 'gainers', 'losers', 'iexvolume', 'iexpercent']
_COLLECTION_TAGS = ['sector', 'tag', 'list']

_PYEX_PROXIES = None


def _getJson(url):
url = _URL_PREFIX + url
resp = requests.get(urlparse(url).geturl())
resp = requests.get(urlparse(url).geturl(), proxies=_PYEX_PROXIES)
if resp.status_code == 200:
return resp.json()
raise PyEXception('Response %d - ' % resp.status_code, resp.text)
Expand Down Expand Up @@ -102,3 +104,8 @@ class PyEXception(Exception):

def _reindex(df, col):
df.set_index(col, inplace=True)


def setProxy(proxies=None):
global _PYEX_PROXIES
_PYEX_PROXIES = proxies

0 comments on commit 25c795c

Please sign in to comment.