Skip to content

Commit 9295c88

Browse files
authored
Merge branch 'master' into master
2 parents 924c7c2 + 3abc3d0 commit 9295c88

File tree

8 files changed

+31
-21
lines changed

8 files changed

+31
-21
lines changed

docs/source/readers/enigma.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Engima
1+
Enigma
22
------
33

44
.. py:module:: pandas_datareader.enigma

docs/source/readers/index.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ Data Readers
1717
nasdaq-trader
1818
oecd
1919
quandl
20-
robinhood
2120
stooq
2221
tiingo
2322
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
@@ -8,6 +8,9 @@ Highlights include:
88
- A new connector for Econdb was introduced. Econdb provides
99
aggregated economic data from 90+ official statistical agencies
1010
(:issue:`615`)
11+
- Immediate deprecation of Robinhood for quotes and historical data. Robinhood
12+
ended support for these endpoints in 1/2019
13+
1114

1215
.. contents:: What's new in v0.8.0
1316
:local:
@@ -24,6 +27,9 @@ Enhancements
2427
Backwards incompatible API changes
2528
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2629

30+
- Immediate deprecation of Robinhood for quotes and historical data. Robinhood
31+
ended support for these endpoints in 1/2019. The Robinhood quotes and daily
32+
readers will raise an ``ImmediateDeprecationError`` when called.
2733

2834

2935
.. _whatsnew_080.bug_fixes:

pandas_datareader/av/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def __init__(self, symbols=None, start=None, end=None, retry_count=3,
2828
if not api_key or not isinstance(api_key, str):
2929
raise ValueError('The AlphaVantage API key must be provided '
3030
'either through the api_key variable or '
31-
'through the environment varaible '
31+
'through the environment variable '
3232
'ALPHAVANTAGE_API_KEY')
3333
self.api_key = api_key
3434

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)

pandas_datareader/yahoo/actions.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,16 @@ def _get_one_action(data):
3333
dividends = DataFrame(data['Dividends']).dropna()
3434
dividends["action"] = "DIVIDEND"
3535
dividends = dividends.rename(columns={'Dividends': 'value'})
36-
actions = concat([actions, dividends]).sort_index(ascending=False)
36+
actions = concat([actions, dividends], sort=True)
37+
actions = actions.sort_index(ascending=False)
3738

3839
if 'Splits' in data.columns:
3940
# Add a label column so we can combine our two DFs
4041
splits = DataFrame(data['Splits']).dropna()
4142
splits["action"] = "SPLIT"
4243
splits = splits.rename(columns={'Splits': 'value'})
43-
actions = concat([actions, splits]).sort_index(ascending=False)
44+
actions = concat([actions, splits], sort=True)
45+
actions = actions.sort_index(ascending=False)
4446

4547
return actions
4648

0 commit comments

Comments
 (0)