Skip to content

Commit cb5bf8d

Browse files
addisonlynchbashtage
authored andcommitted
Deprecated Morningstar Daily Reader (#558)
Immediate deprecation due to Morningstar retiring their endpoint.
1 parent 69f52ed commit cb5bf8d

File tree

5 files changed

+15
-35
lines changed

5 files changed

+15
-35
lines changed

docs/source/remote_data.rst

Lines changed: 7 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Remote Data Access
1919

2020
.. warning::
2121

22-
Yahoo! Finance and Google Finance hav been immediately deprecated. Endpoints from both providers have been retired
22+
Yahoo! Finance, Google Finance, and Morningstar have been immediately deprecated. Endpoints from these providers have been retired
2323

2424
.. _remote_data.data_reader:
2525

@@ -28,7 +28,6 @@ extract data from various Internet sources into a pandas DataFrame.
2828
Currently the following sources are supported:
2929

3030
- :ref:`Tiingo<remote_data.tiingo>`
31-
- :ref:`Morningstar<remote_data.morningstar>`
3231
- :ref:`IEX<remote_data.iex>`
3332
- :ref:`Robinhood<remote_data.robinhood>`
3433
- :ref:`AlphaVantage<remote_data.alphavantage>`
@@ -64,21 +63,6 @@ writing).
6463
df = pdr.get_data_tiingo('GOOG', api_key=os.getenv('TIINGO_API_KEY'))
6564
df.head()
6665
67-
.. _remote_data.morningstar:
68-
69-
Morningstar
70-
===========
71-
OHLC and Volume data is available from Morningstar using the same API which
72-
powers their charts.
73-
74-
.. ipython:: python
75-
76-
import pandas_datareader.data as web
77-
from datetime import datetime
78-
start = datetime(2015, 2, 9)
79-
end = datetime(2017, 5, 24)
80-
f = web.DataReader('F', 'morningstar', start, end)
81-
f.head()
8266
8367
.. _remote_data.iex:
8468

@@ -132,12 +116,12 @@ AlphaVantage
132116
============
133117

134118
`AlphaVantage <https://www.alphavantage.co/documentation>`__ provides realtime
135-
equities and forex data. Free registration is required to get an API key.
119+
equities and forex data. Free registration is required to get an API key.
136120

137121
Historical Time Series Data
138122
^^^^^^^^^^^^^^^^^^^^^^^^^^^
139123

140-
Through the
124+
Through the
141125
`AlphaVantage <https://www.alphavantage.co/documentation>`__ Time Series
142126
endpoints, it is possible to obtain historical equities data for individual
143127
symbols. The following endpoints are available:
@@ -188,7 +172,7 @@ Forex
188172
^^^^^
189173

190174
`AlphaVantage <https://www.alphavantage.co/documentation>`__ provides realtime
191-
currency exchange rates (for physical and digital currencies).
175+
currency exchange rates (for physical and digital currencies).
192176

193177
To request the exchange rate of physical or digital currencies, simply format
194178
as "FROM/TO" as in "USD/JPY".
@@ -198,7 +182,7 @@ as "FROM/TO" as in "USD/JPY".
198182
import os
199183
import pandas_datareader.data as web
200184
201-
f = web.DataReader("USD/JPY", "av-forex",
185+
f = web.DataReader("USD/JPY", "av-forex",
202186
access_key=os.getenv('ALPHAVANTAGE_API_KEY'))
203187
204188
Multiple pairs are are allowable:
@@ -233,7 +217,7 @@ Enigma
233217

234218
Access datasets from `Enigma <https://public.enigma.com>`__,
235219
the world's largest repository of structured public data. Note that the Enigma
236-
URL has changed from `app.enigma.io <https://app.enigma.io>`__ as of release
220+
URL has changed from `app.enigma.io <https://app.enigma.io>`__ as of release
237221
``0.6.0``, as the old API deprecated.
238222

239223
Datasets are unique identified by the ``uuid4`` at the end of a dataset's web address.
@@ -568,7 +552,7 @@ available. More information on the `field <http://www.nasdaqtrader.com/trader.as
568552
569553
Stooq Index Data
570554
================
571-
Google finance doesn't provide common index data download. The Stooq site has the data for download.
555+
Google finance doesn't provide common index data download. The Stooq site has the data for download.
572556
573557
.. ipython:: python
574558

docs/source/whatsnew/v0.7.0.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ v0.7.0 (Xxxxxxx YY, 20ZZ)
55

66
.. warning::
77

8-
Google finance for historical price data has been immediately deprecated.
8+
Google finance and Morningstar for historical price data have been immediately deprecated.
99

1010

1111
Highlights include:
1212

13-
- Immediate deprecation of Google finance for historical price data, as these API endpoints are no longer supported by the provider. Alternate methods are welcome via pull requests, as PDR would like to restore these features.
13+
- Immediate deprecation of Google finance and Morningstar for historical price data, as these API endpoints are no longer supported by their respective providers. Alternate methods are welcome via pull requests, as PDR would like to restore these features.
1414

1515
.. contents:: What's new in v0.7.0
1616
:local:
@@ -52,6 +52,7 @@ Backwards incompatible API changes
5252
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5353

5454
- Deprecation of Google finance daily reader. Google retired the remaining financial data end point in June 2018. It is not possible to reliably retrieve historical price data without this endpoint. The Google daily reader will raise an `ImmediateDeprecationError` when called.
55+
- Deprecation of Morningstar daily reader. Morningstar ended support for the historical price data endpoint in July 2018. It is not possible to retrieve historical price data without this endpoint. The Morningstar daily reader will raise an `ImmediateDeprecationError` when called.
5556
- When requesting multiple symbols from a DailyReader (ex: google, yahoo, IEX)
5657
a MultiIndex DataFrame is now returned. Previously Panel or dict of DataFrames
5758
were returned. (:issue:`297`).

pandas_datareader/mstar/daily.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
from pandas_datareader._utils import SymbolWarning
1010
from pandas_datareader.base import _BaseReader
11+
from pandas_datareader.exceptions import ImmediateDeprecationError, \
12+
DEP_ERROR_MSG
1113
import pandas as pd
1214

1315

@@ -52,6 +54,7 @@ def __init__(self, symbols, start=None, end=None, retry_count=3,
5254
pause=0.1, timeout=30, session=None, freq=None,
5355
incl_splits=False, incl_dividends=False, incl_volume=True,
5456
currency='usd', interval='d'):
57+
raise ImmediateDeprecationError(DEP_ERROR_MSG.format("Morningstar"))
5558
super(MorningstarDailyReader, self).__init__(symbols, start, end,
5659
retry_count, pause,
5760
timeout, session, freq)

pandas_datareader/tests/mstar/test_daily.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,13 @@
66
import requests
77

88
import pandas_datareader.data as web
9-
from pandas_datareader._testing import skip_on_exception
10-
from pandas_datareader._utils import RemoteDataError
119
from pandas_datareader.data import MorningstarDailyReader
1210
from pandas_datareader._utils import SymbolWarning
1311

1412

13+
@pytest.mark.xfail(reason="Deprecated")
1514
class TestMorningstarDaily(object):
1615

17-
@skip_on_exception(RemoteDataError)
1816
def test_invalid_date(self):
1917
with pytest.raises(ValueError):
2018
web.DataReader("MSFT", 'morningstar', start="1990-03-A")
@@ -36,20 +34,17 @@ def test_invalid_symbol_type(self):
3634
with pytest.raises(TypeError):
3735
web.DataReader([12332], data_source='morningstar', retry_count=0)
3836

39-
@skip_on_exception(RemoteDataError)
4037
def test_mstar(self):
4138
start = datetime(2014, 3, 5)
4239
end = datetime(2018, 1, 18)
4340
df = web.DataReader('MSFT', 'morningstar', start=start, end=end)
4441
assert (df['Open'][-1] == 89.8)
4542

46-
@skip_on_exception(RemoteDataError)
4743
def test_get_data_single_symbol(self):
4844
# single symbol
4945
# just test that we succeed
5046
web.get_data_morningstar('GOOG')
5147

52-
@skip_on_exception(RemoteDataError)
5348
def test_get_data_interval(self):
5449
# daily interval data
5550
pan = web.get_data_morningstar(symbols='XOM', start='2013-01-01',
@@ -70,13 +65,11 @@ def test_get_data_interval(self):
7065
with pytest.raises(ValueError):
7166
web.get_data_morningstar('XOM', interval='NOT VALID')
7267

73-
@skip_on_exception(RemoteDataError)
7468
def test_get_data_multiple_symbols(self):
7569
# just test that we succeed
7670
sl = ['AAPL', 'AMZN', 'GOOG']
7771
web.get_data_morningstar(sl, '2012')
7872

79-
@skip_on_exception(RemoteDataError)
8073
def test_get_data_multiple_symbols_two_dates(self):
8174
df = web.get_data_morningstar(symbols=['XOM', 'MSFT'],
8275
start='2013-01-01',
@@ -112,7 +105,6 @@ def excl_volume_column_multi(self):
112105
end='2013-03-04', incl_volume=False)
113106
assert ("Volume" not in df.keys())
114107

115-
@skip_on_exception(RemoteDataError)
116108
def test_mstar_reader_class(self):
117109
dr = MorningstarDailyReader(symbols="GOOG", interval="d")
118110
df = dr.read()
@@ -125,7 +117,6 @@ def test_mstar_reader_class(self):
125117
dr.read()
126118
assert dr.session is session
127119

128-
@skip_on_exception(RemoteDataError)
129120
def test_mstar_DataReader_multi(self):
130121
start = datetime(2010, 1, 1)
131122
end = datetime(2015, 5, 9)

pandas_datareader/tests/test_data.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ def test_read_fred(self):
2121
vix = DataReader("VIXCLS", "fred")
2222
assert isinstance(vix, DataFrame)
2323

24+
@pytest.mark.xfail(reason="Deprecated")
2425
def test_read_mstar(self):
2526
gs = DataReader("GS", data_source="morningstar")
2627
assert isinstance(gs, DataFrame)

0 commit comments

Comments
 (0)