Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLN/REF: Mark Deprecated Morningstar API #558

Merged
merged 1 commit into from
Aug 12, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 7 additions & 23 deletions docs/source/remote_data.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Remote Data Access

.. warning::

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

.. _remote_data.data_reader:

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

- :ref:`Tiingo<remote_data.tiingo>`
- :ref:`Morningstar<remote_data.morningstar>`
- :ref:`IEX<remote_data.iex>`
- :ref:`Robinhood<remote_data.robinhood>`
- :ref:`AlphaVantage<remote_data.alphavantage>`
Expand Down Expand Up @@ -64,21 +63,6 @@ writing).
df = pdr.get_data_tiingo('GOOG', api_key=os.getenv('TIINGO_API_KEY'))
df.head()

.. _remote_data.morningstar:

Morningstar
===========
OHLC and Volume data is available from Morningstar using the same API which
powers their charts.

.. ipython:: python

import pandas_datareader.data as web
from datetime import datetime
start = datetime(2015, 2, 9)
end = datetime(2017, 5, 24)
f = web.DataReader('F', 'morningstar', start, end)
f.head()

.. _remote_data.iex:

Expand Down Expand Up @@ -132,12 +116,12 @@ AlphaVantage
============

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

Historical Time Series Data
^^^^^^^^^^^^^^^^^^^^^^^^^^^

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

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

To request the exchange rate of physical or digital currencies, simply format
as "FROM/TO" as in "USD/JPY".
Expand All @@ -198,7 +182,7 @@ as "FROM/TO" as in "USD/JPY".
import os
import pandas_datareader.data as web

f = web.DataReader("USD/JPY", "av-forex",
f = web.DataReader("USD/JPY", "av-forex",
access_key=os.getenv('ALPHAVANTAGE_API_KEY'))

Multiple pairs are are allowable:
Expand Down Expand Up @@ -233,7 +217,7 @@ Enigma

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

Datasets are unique identified by the ``uuid4`` at the end of a dataset's web address.
Expand Down Expand Up @@ -568,7 +552,7 @@ available. More information on the `field <http://www.nasdaqtrader.com/trader.as

Stooq Index Data
================
Google finance doesn't provide common index data download. The Stooq site has the data for download.
Google finance doesn't provide common index data download. The Stooq site has the data for download.

.. ipython:: python

Expand Down
5 changes: 3 additions & 2 deletions docs/source/whatsnew/v0.7.0.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ v0.7.0 (Xxxxxxx YY, 20ZZ)

.. warning::

Google finance for historical price data has been immediately deprecated.
Google finance and Morningstar for historical price data have been immediately deprecated.


Highlights include:

- 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.
- 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.

.. contents:: What's new in v0.7.0
:local:
Expand Down Expand Up @@ -49,6 +49,7 @@ Backwards incompatible API changes
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

- 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.
- 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.
- When requesting multiple symbols from a DailyReader (ex: google, yahoo, IEX)
a MultiIndex DataFrame is now returned. Previously Panel or dict of DataFrames
were returned. (:issue:`297`).
Expand Down
3 changes: 3 additions & 0 deletions pandas_datareader/mstar/daily.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

from pandas_datareader._utils import SymbolWarning
from pandas_datareader.base import _BaseReader
from pandas_datareader.exceptions import ImmediateDeprecationError, \
DEP_ERROR_MSG
import pandas as pd


Expand Down Expand Up @@ -52,6 +54,7 @@ def __init__(self, symbols, start=None, end=None, retry_count=3,
pause=0.1, timeout=30, session=None, freq=None,
incl_splits=False, incl_dividends=False, incl_volume=True,
currency='usd', interval='d'):
raise ImmediateDeprecationError(DEP_ERROR_MSG.format("Morningstar"))
super(MorningstarDailyReader, self).__init__(symbols, start, end,
retry_count, pause,
timeout, session, freq)
Expand Down
11 changes: 1 addition & 10 deletions pandas_datareader/tests/mstar/test_daily.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,13 @@
import requests

import pandas_datareader.data as web
from pandas_datareader._testing import skip_on_exception
from pandas_datareader._utils import RemoteDataError
from pandas_datareader.data import MorningstarDailyReader
from pandas_datareader._utils import SymbolWarning


@pytest.mark.xfail(reason="Deprecated")
class TestMorningstarDaily(object):

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

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

@skip_on_exception(RemoteDataError)
def test_get_data_single_symbol(self):
# single symbol
# just test that we succeed
web.get_data_morningstar('GOOG')

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

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

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

@skip_on_exception(RemoteDataError)
def test_mstar_reader_class(self):
dr = MorningstarDailyReader(symbols="GOOG", interval="d")
df = dr.read()
Expand All @@ -125,7 +117,6 @@ def test_mstar_reader_class(self):
dr.read()
assert dr.session is session

@skip_on_exception(RemoteDataError)
def test_mstar_DataReader_multi(self):
start = datetime(2010, 1, 1)
end = datetime(2015, 5, 9)
Expand Down
1 change: 1 addition & 0 deletions pandas_datareader/tests/test_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ def test_read_fred(self):
vix = DataReader("VIXCLS", "fred")
assert isinstance(vix, DataFrame)

@pytest.mark.xfail(reason="Deprecated")
def test_read_mstar(self):
gs = DataReader("GS", data_source="morningstar")
assert isinstance(gs, DataFrame)
Expand Down