def get_available_symbols(**kwargs): """ MOVED to iexfinance.refdata.get_symbols """ import warnings warnings.warn(WNG_MSG % ("get_available_symbols", "refdata.get_symbols")) _ALL_SYMBOLS_URL = "https://api.iextrading.com/1.0/ref-data/symbols" handler = _IEXBase(**kwargs) response = handler._execute_iex_query(_ALL_SYMBOLS_URL) if not response: raise IEXQueryError("Could not download all symbols") else: return response
def get_available_symbols(**kwargs): """ Top-level function to obtain IEX available symbols Parameters ---------- kwargs: Additional Request Parameters (see base class) Returns ------- data: list List of dictionary reference items for each symbol """ _ALL_SYMBOLS_URL = "https://api.iextrading.com/1.0/ref-data/symbols" handler = _IEXBase(**kwargs) response = handler._execute_iex_query(_ALL_SYMBOLS_URL) if not response: raise IEXQueryError("Could not download all symbols") else: return response
def test_cloud_fails_no_token(self, block_keys): with pytest.raises(IEXAuthenticationError): _IEXBase()
def test_token_arg(self, set_keys): a = _IEXBase(token="TESTKEY2") assert a.token == "TESTKEY2"
def test_token_env(self, set_keys): a = _IEXBase() assert a.token == "TESTKEY"
def test_invalid_format_env(self, bad_format): with pytest.raises(ValueError): _IEXBase()
def test_invalid_output_format(self): with pytest.raises(ValueError): _IEXBase(output_format='BADFORMAT')
def test_output_format_env(self, pandas_format): base = _IEXBase() assert base.output_format == 'pandas'
def test_output_format_passed(self): base = _IEXBase(output_format='pandas') assert base.output_format == 'pandas'
def test_all_defaults(self, block_format_env): base = _IEXBase() assert base.output_format == 'json' assert base.pause == 0.5 assert base.token is None
def test_all_defaults(self, block_format_env): base = _IEXBase() assert base.output_format == "pandas" assert base.pause == 0.5