Skip to content

Commit 3abc3d0

Browse files
authored
Merge pull request #609 from addisonlynch/depr-robinhood-api
CLN/REF: Mark deprecated Robinhood API
2 parents 80a94c5 + 20ec91b commit 3abc3d0

File tree

5 files changed

+25
-17
lines changed

5 files changed

+25
-17
lines changed

docs/source/readers/index.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ Data Readers
1616
nasdaq-trader
1717
oecd
1818
quandl
19-
robinhood
2019
stooq
2120
tiingo
2221
tsp

docs/source/remote_data.rst

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ Remote Data Access
2121

2222
Yahoo! Finance, Google Finance, and Morningstar have been immediately deprecated. Endpoints from these providers have been retired
2323

24+
.. warning::
25+
26+
Robinhood has been immediately deprecated. Endpoints from this provider
27+
have been retired.
28+
2429
.. _remote_data.data_reader:
2530

2631
Functions from :mod:`pandas_datareader.data` and :mod:`pandas_datareader.wb`
@@ -29,7 +34,6 @@ Currently the following sources are supported:
2934

3035
- :ref:`Tiingo<remote_data.tiingo>`
3136
- :ref:`IEX<remote_data.iex>`
32-
- :ref:`Robinhood<remote_data.robinhood>`
3337
- :ref:`Alpha Vantage<remote_data.alphavantage>`
3438
- :ref:`Enigma<remote_data.enigma>`
3539
- :ref:`Quandl<remote_data.quandl>`
@@ -94,21 +98,6 @@ A third interface to the deep API is exposed through
9498
f[:10]
9599
96100
97-
.. _remote_data.robinhood:
98-
99-
Robinhood
100-
=========
101-
`Robinhood <https://www.robinhood.com>`__ is a stock trading platform with an
102-
API that provides a limited set of data. Historical daily data is limited to 1
103-
year relative to today.
104-
105-
.. ipython:: python
106-
107-
import pandas_datareader.data as web
108-
from datetime import datetime
109-
f = web.DataReader('F', 'robinhood')
110-
f.head()
111-
112101
.. _remote_data.alphavantage:
113102

114103
Alpha Vantage

docs/source/whatsnew/v0.8.0.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ v0.8.0 (TBD)
55

66
Highlights include:
77

8+
- Immediate deprecation of Robinhood for quotes and historical data. Robinhood
9+
ended support for these endpoints in 1/2019
10+
811
.. contents:: What's new in v0.8.0
912
:local:
1013
:backlinks: none
@@ -20,6 +23,9 @@ Enhancements
2023
Backwards incompatible API changes
2124
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2225

26+
- Immediate deprecation of Robinhood for quotes and historical data. Robinhood
27+
ended support for these endpoints in 1/2019. The Robinhood quotes and daily
28+
readers will raise an ``ImmediateDeprecationError`` when called.
2329

2430

2531
.. _whatsnew_080.bug_fixes:

pandas_datareader/robinhood.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
import pandas as pd
22

33
from pandas_datareader.base import _BaseReader
4+
from pandas_datareader.exceptions import (ImmediateDeprecationError,
5+
DEP_ERROR_MSG)
46

57

68
class RobinhoodQuoteReader(_BaseReader):
79
"""
810
Read quotes from Robinhood
911
12+
DEPRECATED 1/2019 - Robinhood ended support for the endpoints used by this
13+
reader
14+
1015
Parameters
1116
----------
1217
symbols : {str, List[str]}
@@ -28,6 +33,7 @@ class RobinhoodQuoteReader(_BaseReader):
2833

2934
def __init__(self, symbols, start=None, end=None, retry_count=3, pause=.1,
3035
timeout=30, session=None, freq=None):
36+
raise ImmediateDeprecationError(DEP_ERROR_MSG.format("Robinhood"))
3137
super(RobinhoodQuoteReader, self).__init__(symbols, start, end,
3238
retry_count, pause,
3339
timeout, session, freq)
@@ -72,6 +78,9 @@ class RobinhoodHistoricalReader(RobinhoodQuoteReader):
7278
"""
7379
Read historical values from Robinhood
7480
81+
DEPRECATED 1/2019 - Robinhood ended support for the endpoints used by this
82+
reader
83+
7584
Parameters
7685
----------
7786
symbols : {str, List[str]}
@@ -110,6 +119,7 @@ class RobinhoodHistoricalReader(RobinhoodQuoteReader):
110119
def __init__(self, symbols, start=None, end=None, retry_count=3, pause=.1,
111120
timeout=30, session=None, freq=None, interval='day',
112121
span='year'):
122+
raise ImmediateDeprecationError(DEP_ERROR_MSG.format("Robinhood"))
113123
super(RobinhoodHistoricalReader, self).__init__(symbols, start, end,
114124
retry_count, pause,
115125
timeout, session, freq)

pandas_datareader/tests/test_robinhood.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ def symbols(request):
1414
return request.param
1515

1616

17+
@pytest.mark.xfail(reason="Deprecated")
1718
def test_robinhood_quote(symbols):
1819
df = RobinhoodQuoteReader(symbols=symbols).read()
1920
assert isinstance(df, pd.DataFrame)
@@ -22,6 +23,7 @@ def test_robinhood_quote(symbols):
2223
assert df.shape[1] == len(symbols)
2324

2425

26+
@pytest.mark.xfail(reason="Deprecated")
2527
def test_robinhood_quote_too_many():
2628
syms = np.random.randint(65, 90, size=(10000, 4)).tolist()
2729
syms = list(map(lambda r: ''.join(map(chr, r)), syms))
@@ -30,6 +32,7 @@ def test_robinhood_quote_too_many():
3032
RobinhoodQuoteReader(symbols=syms)
3133

3234

35+
@pytest.mark.xfail(reason="Deprecated")
3336
def test_robinhood_historical_too_many():
3437
syms = np.random.randint(65, 90, size=(10000, 4)).tolist()
3538
syms = list(map(lambda r: ''.join(map(chr, r)), syms))
@@ -40,6 +43,7 @@ def test_robinhood_historical_too_many():
4043
RobinhoodHistoricalReader(symbols=syms[:76])
4144

4245

46+
@pytest.mark.xfail(reason="Deprecated")
4347
def test_robinhood_historical(symbols):
4448
df = RobinhoodHistoricalReader(symbols=symbols).read()
4549
assert isinstance(df, pd.DataFrame)

0 commit comments

Comments
 (0)