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

Commit

Permalink
fixes #69
Browse files Browse the repository at this point in the history
  • Loading branch information
timkpaine committed Jul 6, 2019
1 parent edbe6f6 commit 553c516
Showing 1 changed file with 16 additions and 24 deletions.
40 changes: 16 additions & 24 deletions pyEX/refdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ def internationalSymbols(region='', exchange='', token='', version='', filter=''
return _getJson('ref-data/region/us/symbols', token, version, filter)


def fxSymbols(token='', version='', filter=''):
def fxSymbols(token='', version=''):
'''This call returns a list of supported currencies and currency pairs.
https://iexcloud.io/docs/api/#fx-symbols
Expand All @@ -324,12 +324,11 @@ def fxSymbols(token='', version='', filter=''):
Args:
token (string); Access token
version (string); API version
filter (string); filters: https://iexcloud.io/docs/api/#filter-results
Returns:
dict: result
'''
return _getJson('ref-data/fx/symbols', token, version, filter)
return _getJson('ref-data/fx/symbols', token, version)


def optionsSymbols(token='', version='', filter=''):
Expand Down Expand Up @@ -493,7 +492,7 @@ def optionsSymbolsDF(token='', version='', filter=''):
return df


def symbolsList(token='', version='', filter=''):
def symbolsList(token='', version=''):
'''This call returns an array of symbols that IEX Cloud supports for API calls.
https://iexcloud.io/docs/api/#symbols
Expand All @@ -502,15 +501,14 @@ def symbolsList(token='', version='', filter=''):
Args:
token (string); Access token
version (string); API version
filter (string); filters: https://iexcloud.io/docs/api/#filter-results
Returns:
list: result
'''
return symbolsDF(token, version, filter).index.tolist()
return [x['symbol'] for x in symbols(token, version, filter='symbol')]


def iexSymbolsList(token='', version='', filter=''):
def iexSymbolsList(token='', version=''):
'''This call returns an array of symbols the Investors Exchange supports for trading.
This list is updated daily as of 7:45 a.m. ET. Symbols may be added or removed by the Investors Exchange after the list was produced.
Expand All @@ -520,15 +518,14 @@ def iexSymbolsList(token='', version='', filter=''):
Args:
token (string); Access token
version (string); API version
filter (string); filters: https://iexcloud.io/docs/api/#filter-results
Returns:
list: result
'''
return iexSymbolsDF(token, version, filter).index.tolist()
return [x['symbol'] for x in iexSymbols(token, version, filter='symbol')]


def mutualFundSymbolsList(token='', version='', filter=''):
def mutualFundSymbolsList(token='', version=''):
'''This call returns an array of mutual fund symbols that IEX Cloud supports for API calls.
https://iexcloud.io/docs/api/#mutual-fund-symbols
Expand All @@ -537,15 +534,14 @@ def mutualFundSymbolsList(token='', version='', filter=''):
Args:
token (string); Access token
version (string); API version
filter (string); filters: https://iexcloud.io/docs/api/#filter-results
Returns:
List: result
'''
return mutualFundSymbolsDF(token, version, filter).index.tolist()
return [x['symbol'] for x in mutualFundSymbols(token, version, filter='symbol')]


def otcSymbolsList(token='', version='', filter=''):
def otcSymbolsList(token='', version=''):
'''This call returns an array of OTC symbols that IEX Cloud supports for API calls.
https://iexcloud.io/docs/api/#otc-symbols
Expand All @@ -554,15 +550,14 @@ def otcSymbolsList(token='', version='', filter=''):
Args:
token (string); Access token
version (string); API version
filter (string); filters: https://iexcloud.io/docs/api/#filter-results
Returns:
list: result
'''
return otcSymbolsDF(token, version, filter).index.tolist()
return [x['symbol'] for x in otcSymbols(token, version, filter='symbol')]


def internationalSymbolsList(region='', exchange='', token='', version='', filter=''):
def internationalSymbolsList(region='', exchange='', token='', version=''):
'''This call returns an array of international symbols that IEX Cloud supports for API calls.
https://iexcloud.io/docs/api/#international-symbols
Expand All @@ -573,15 +568,14 @@ def internationalSymbolsList(region='', exchange='', token='', version='', filte
exchange (string): Case insensitive string of Exchange using IEX Supported Exchanges list
token (string); Access token
version (string); API version
filter (string); filters: https://iexcloud.io/docs/api/#filter-results
Returns:
list: result
'''
return internationalSymbolsDF(region, exchange, token, version, filter).index.tolist()
return [x['symbol'] for x in internationalSymbols(region, exchange, token, version, filter='symbol')]


def fxSymbolsList(token='', version='', filter=''):
def fxSymbolsList(token='', version=''):
'''This call returns a list of supported currencies and currency pairs.
https://iexcloud.io/docs/api/#fx-symbols
Expand All @@ -590,12 +584,11 @@ def fxSymbolsList(token='', version='', filter=''):
Args:
token (string); Access token
version (string); API version
filter (string); filters: https://iexcloud.io/docs/api/#filter-results
Returns:
list: result
'''
fx = fxSymbols(token, version, filter)
fx = fxSymbols(token, version)
ret = [[], []]
for c in fx['currencies']:
ret[0].append(c['code'])
Expand All @@ -604,7 +597,7 @@ def fxSymbolsList(token='', version='', filter=''):
return ret


def optionsSymbolsList(token='', version='', filter=''):
def optionsSymbolsList(token='', version=''):
'''This call returns an object keyed by symbol with the value of each symbol being an array of available contract dates.
https://iexcloud.io/docs/api/#options-symbols
Expand All @@ -613,12 +606,11 @@ def optionsSymbolsList(token='', version='', filter=''):
Args:
token (string); Access token
version (string); API version
filter (string); filters: https://iexcloud.io/docs/api/#filter-results
Returns:
list: result
'''
return optionsSymbolsDF(token, version, filter).index.tolist()
return [x['symbol'] for x in optionsSymbols(token, version, filter='symbol')]


@deprecated(details='Deprecated: IEX Cloud status unkown')
Expand Down

0 comments on commit 553c516

Please # to comment.