diff --git a/docs/source/usage.rst b/docs/source/usage.rst index c6903be..da56efa 100644 --- a/docs/source/usage.rst +++ b/docs/source/usage.rst @@ -35,7 +35,7 @@ Account Stocks ------ -.. seealso:: For more information, see `Stocks `__. +.. seealso:: For more information, see :ref:`Stocks`. @@ -127,9 +127,6 @@ or for a ``pandas.DataFrame`` indexed by each minute: Endpoints ~~~~~~~~~ -The Stock endpoints of the `IEX Developer -API `__ are below, each of which -contains data regarding a different aspect of the security/securities. The ``Stock`` object can obtain each of these endpoints. Requests for single symbols will return the *exact* results from that endpoint as shown in the IEX API documentation (see below). Requests diff --git a/docs/source/whatsnew/v0.4.0.txt b/docs/source/whatsnew/v0.4.0.txt index 8adc05e..b9b79ae 100644 --- a/docs/source/whatsnew/v0.4.0.txt +++ b/docs/source/whatsnew/v0.4.0.txt @@ -1,10 +1,10 @@ .. _whatsnew_040: -v0.4.0 (TBA) -------------------------- +v0.4.0 (2/21/2019) +------------------ -This is a major release from 0.3.0, and we recommend that all users +This is a major release from 0.3.5, and we recommend that all users update. @@ -86,6 +86,8 @@ Backwards Incompatible Changes - ``iexfinance.stocks.get_todays_earnings`` deprecated and renamed ``get_earnings_today`` - ``iexfinance.stocks.get_relevant`` deprecated and renamed ``get_relevant_stocks`` +- ``iexfinance.stocks.get_all`` is now available for the Version 1.0 Developer + API only. .. whatsnew_040.bug_fixes: diff --git a/iexfinance/stocks/base.py b/iexfinance/stocks/base.py index 32e667c..5b726ad 100644 --- a/iexfinance/stocks/base.py +++ b/iexfinance/stocks/base.py @@ -3,6 +3,7 @@ from iexfinance.base import _IEXBase from iexfinance.utils import _handle_lists, no_pandas, cloud_endpoint from iexfinance.utils.exceptions import IEXSymbolError, IEXEndpointError +from iexfinance.utils import legacy_endpoint class Stock(_IEXBase): @@ -45,6 +46,7 @@ def __init__(self, symbols=None, **kwargs): self.endpoints = [] super(Stock, self).__init__(**kwargs) + @legacy_endpoint def get_all(self): """ Returns all endpoints, indexed by endpoint title for each symbol diff --git a/iexfinance/tests/test_stocks.py b/iexfinance/tests/test_stocks.py index b639ce7..b4e4d57 100644 --- a/iexfinance/tests/test_stocks.py +++ b/iexfinance/tests/test_stocks.py @@ -46,18 +46,21 @@ def setup_class(self): json_parse_float=Decimal) self.cshare5 = Stock("gig^") - @pytest.mark.xfail(reason="Unstable / errored IEX cloud endpoint.") + @pytest.mark.xfail(reason="Unstable.") + @pytest.mark.legacy def test_invalid_symbol(self): data = Stock("BAD SYMBOL") with pytest.raises(IEXSymbolError): data.get_price() - @pytest.mark.xfail(reason="Unsable / errored IEX cloud endpoint.") + @pytest.mark.xfail(reason="Unstable") + @pytest.mark.legacy def test_get_all_format(self): data = self.cshare.get_all() assert isinstance(data, dict) - @pytest.mark.xfail(reason="Unsable / errored IEX cloud endpoint.") + @pytest.mark.xfail(reason="Unstable.") + @pytest.mark.legacy def test_get_all(self): data = self.cshare.get_all() assert len(data) == 20 @@ -341,11 +344,13 @@ def test_get_endpoints_bad_endpoint(self): with pytest.raises(IEXEndpointError): self.cbatch.get_endpoints("BAD ENDPOINT") + @pytest.mark.legacy def test_get_all(self): data = self.cbatch.get_all() assert len(data) == 2 assert len(data["AAPL"]) == 20 + @pytest.mark.legacy def test_get_all_format(self): data = self.cbatch.get_all() assert isinstance(data, dict)