Ejemplo n.º 1
0
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
Ejemplo n.º 2
0
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
Ejemplo n.º 3
0
 def test_cloud_fails_no_token(self, block_keys):
     with pytest.raises(IEXAuthenticationError):
         _IEXBase()
Ejemplo n.º 4
0
    def test_token_arg(self, set_keys):
        a = _IEXBase(token="TESTKEY2")

        assert a.token == "TESTKEY2"
Ejemplo n.º 5
0
    def test_token_env(self, set_keys):
        a = _IEXBase()

        assert a.token == "TESTKEY"
Ejemplo n.º 6
0
 def test_invalid_format_env(self, bad_format):
     with pytest.raises(ValueError):
         _IEXBase()
Ejemplo n.º 7
0
 def test_invalid_output_format(self):
     with pytest.raises(ValueError):
         _IEXBase(output_format='BADFORMAT')
Ejemplo n.º 8
0
    def test_output_format_env(self, pandas_format):
        base = _IEXBase()

        assert base.output_format == 'pandas'
Ejemplo n.º 9
0
    def test_output_format_passed(self):
        base = _IEXBase(output_format='pandas')

        assert base.output_format == 'pandas'
Ejemplo n.º 10
0
    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
Ejemplo n.º 11
0
    def test_all_defaults(self, block_format_env):
        base = _IEXBase()

        assert base.output_format == "pandas"
        assert base.pause == 0.5