Skip to content

DOC: Fix issues in doc build #1002

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

Merged
merged 4 commits into from
Apr 3, 2025
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
2 changes: 1 addition & 1 deletion ci/azure/azure_template_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ jobs:
- script: |
echo "Testing editable install"
echo pytest --durations=25 pandas_datareader/tests
pytest --durations=25 pandas_datareader/tests
pytest --durations=25 --cov-config .coveragerc --cov=pandas_datareader --cov-report xml:coverage.xml --cov-report term --junitxml=junit/test-results.xml pandas_datareader/tests
displayName: 'Run tests'

- task: PublishTestResults@2
Expand Down
1 change: 1 addition & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ ipython
matplotlib
requests_cache
pydata_sphinx_theme
pickleshare
10 changes: 5 additions & 5 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@
#
# The short X.Y version.
version = pdr.__version__.split("+")[0]

if "+" in pdr.__version__:
commit = pdr.__version__.split("+")[1]
commits_since_tag, commit_hash = commit.split(".")[:2]
commit_hash = commit_hash[1:]
commit = pdr.__version__.split("dev")[1]
commits_since_tag, commit_hash = commit.split("+")
commit = " (+" + commits_since_tag + ", " + commit_hash + ")"
version += commit
# The full version, including alpha/beta/rc tags.
Expand Down Expand Up @@ -204,6 +204,6 @@


extlinks = {
"issue": ("https://github.com/pydata/pandas-datareader/issues/%s", "GH"),
"wiki": ("https://github.com/pydata/pandas-datareader/wiki/%s", "wiki "),
"issue": ("https://github.com/pydata/pandas-datareader/issues/%s", "GH %s"),
"wiki": ("https://github.com/pydata/pandas-datareader/wiki/%s", "wiki %s"),
}
60 changes: 49 additions & 11 deletions docs/source/remote_data.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,25 +25,33 @@ Remote Data Access

Functions from :mod:`pandas_datareader.data` and :mod:`pandas_datareader.wb`
extract data from various Internet sources into a pandas DataFrame.
Currently the following sources are supported:
Currently the following sources are supported and tested:

- :ref:`Alpha Vantage<remote_data.alphavantage>`
- :ref:`Econdb<remote_data.econdb>`
- :ref:`Enigma<remote_data.enigma>`
- :ref:`Eurostat<remote_data.eurostat>`
- :ref:`IEX<remote_data.iex>`
- :ref:`St.Louis FED (FRED)<remote_data.fred>`
- :ref:`Kenneth French's data library<remote_data.ff>`
- :ref:`Stooq<remote_data.stooq>`
- :ref:`Enigma<remote_data.enigma>`
- :ref:`MOEX<remote_data.moex>`
- :ref:`Nasdaq Trader symbol definitions<remote_data.nasdaq_symbols>`
- :ref:`Naver Finance<remote_data.naver>`
- :ref:`OECD<remote_data.oecd>`


The following sources may not be working since they require an API key for testing:

- :ref:`Alpha Vantage<remote_data.alphavantage>`
- :ref:`Quandl<remote_data.quandl>`
- :ref:`St.Louis FED (FRED)<remote_data.fred>`
- :ref:`Stooq<remote_data.stooq>`
- :ref:`Thrift Savings Plan<remote_data.tsp>`
- :ref:`Tiingo<remote_data.tiingo>`
- :ref:`World Bank<remote_data.wb>`
- :ref:`IEX<remote_data.iex>`

The following sources have been previously supported but are fully working in the current version:

- :ref:`Yahoo Finance<remote_data.yahoo>`
- :ref:`Eurostat<remote_data.eurostat>`
- :ref:`OECD<remote_data.oecd>`
- :ref:`Econdb<remote_data.econdb>`
- :ref:`World Bank<remote_data.wb>`
- :ref:`Thrift Savings Plan<remote_data.tsp>`


It should be noted, that various sources support different kinds of data, so not all sources implement the same methods and the data elements returned might also differ.

Expand Down Expand Up @@ -447,6 +455,7 @@ FRED
====

.. ipython:: python
:okexcept:

import pandas_datareader.data as web
import datetime
Expand All @@ -470,6 +479,7 @@ Access datasets from the `Fama/French Data Library
The ``get_available_datasets`` function returns a list of all available datasets.

.. ipython:: python
:okexcept:

from pandas_datareader.famafrench import get_available_datasets
import pandas_datareader.data as web
Expand Down Expand Up @@ -650,6 +660,11 @@ See docstrings for more info.
OECD
====

.. warning::

The OECD reader is currently not working. PRs to fix are welcome.


`OECD Statistics <http://stats.oecd.org/>`__ are available via ``DataReader``.
You have to specify OECD's data set code.

Expand All @@ -658,6 +673,7 @@ example is to download 'Trade Union Density' data which set code is 'TUD'.


.. ipython:: python
:okexcept:

import pandas_datareader.data as web
import datetime
Expand All @@ -673,6 +689,11 @@ example is to download 'Trade Union Density' data which set code is 'TUD'.
Eurostat
========

.. warning::

The Eurostat reader is currently not working. PRs to fix are welcome.


`Eurostat <http://ec.europa.eu/eurostat/>`__ are available via ``DataReader``.

Get `Rail accidents by type of accident (ERA data) <http://appsso.eurostat.ec.europa.eu/nui/show.do?dataset=tran_sf_railac&lang=en>`_ data. The result will be a ``DataFrame`` which has ``DatetimeIndex`` as index and ``MultiIndex`` of attributes or countries as column. The target URL is:
Expand All @@ -682,6 +703,7 @@ Get `Rail accidents by type of accident (ERA data) <http://appsso.eurostat.ec.eu
You can specify dataset ID 'tran_sf_railac' to get corresponding data via ``DataReader``.

.. ipython:: python
:okexcept:

import pandas_datareader.data as web

Expand All @@ -693,9 +715,15 @@ You can specify dataset ID 'tran_sf_railac' to get corresponding data via ``Data
Thrift Savings Plan (TSP) Fund Data
===================================

.. warning::

The TSP reader is currently not working. PRs to fix are welcome.


Download mutual fund index prices for the Thrift Savings Plan (TSP).

.. ipython:: python
:okexcept:

import pandas_datareader.tsp as tsp
tspreader = tsp.TSPReader(start='2015-10-1', end='2015-12-31')
Expand Down Expand Up @@ -738,6 +766,7 @@ Stooq Index Data
Google finance doesn't provide common index data download. The Stooq site has the data for download.

.. ipython:: python
:okexcept:

import pandas_datareader.data as web
f = web.DataReader('^DJI', 'stooq')
Expand All @@ -753,6 +782,7 @@ The Moscow Exchange (MOEX) provides historical data.
``pandas_datareader.moex.MoexReader(*args).read()``

.. ipython:: python
:okexcept:

import pandas_datareader as pdr
f = pdr.get_data_moex(['USD000UTSTOM', 'MAGN'], '2020-07-02', '2020-07-07')
Expand All @@ -772,6 +802,7 @@ Naver Finance Data
(`KOSPI`_, `KOSDAQ`_) historical data.

.. ipython:: python
:okexcept:

import pandas_datareader.data as web
df = web.DataReader('005930', 'naver', start='2019-09-10', end='2019-10-09')
Expand All @@ -784,6 +815,12 @@ Naver Finance Data

Yahoo Finance Data
==================

.. warning::

The Yahoo Finance reader is currently not working. PRs to fix are welcome.


Yahoo Finance provides stock market data

The following endpoints are available:
Expand All @@ -793,6 +830,7 @@ The following endpoints are available:
* ``yahoo-dividends`` - retrieve historical dividends

.. ipython:: python
:okexcept:

import pandas_datareader.data as web
import pandas as pd
Expand Down
2 changes: 2 additions & 0 deletions pandas_datareader/tests/test_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@


class TestDataReader:

@pytest.mark.xfail(reason="Changes in API need fixes")
def test_read_iex(self):
gs = DataReader("GS", "iex-last")
assert isinstance(gs, DataFrame)
Expand Down
2 changes: 1 addition & 1 deletion pandas_datareader/tests/test_econdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from pandas_datareader import data as web

pytestmark = pytest.mark.stable
pytestmark = pytest.mark.xfail(reason="Changes in API need fixes")


def assert_equal(x, y):
Expand Down
2 changes: 1 addition & 1 deletion pandas_datareader/tests/test_eurostat.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from pandas_datareader import data as web

pytestmark = pytest.mark.stable
pytestmark = pytest.mark.xfail(reason="Changes in API need fixes")


class TestEurostat:
Expand Down
2 changes: 2 additions & 0 deletions pandas_datareader/tests/test_iex.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
)
from pandas_datareader.exceptions import UnstableAPIWarning

pytestmark = pytest.mark.xfail(reason="Changes in API need fixes")


class TestIEX:
@classmethod
Expand Down
1 change: 1 addition & 0 deletions pandas_datareader/tests/test_oecd.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ def test_get_un_den(self):
expected = pd.Series(values, index=index, name=label)
tm.assert_series_equal(df[label], expected)

@pytest.mark.xfail(reason="Changes in API need fixes")
def test_get_tourism(self):
df = web.DataReader(
"TOURISM_INBOUND",
Expand Down
2 changes: 1 addition & 1 deletion pandas_datareader/tests/test_stooq.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def test_stooq_sp500():
assert f.shape[0] > 0


@pytest.mark.xfail(reason="No longer works as of Otober 2023")
@pytest.mark.xfail(reason="No longer works as of October 2023")
def test_stooq_clx19f():
f = get_data_stooq("CLX26.F", start="20200101", end="20200115")
assert f.shape[0] > 0
Expand Down
2 changes: 1 addition & 1 deletion pandas_datareader/tests/yahoo/test_yahoo.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

XFAIL_REASON = "Known connection failures on Yahoo when testing!"

pytestmark = pytest.mark.stable
pytestmark = pytest.mark.xfail(reason="Changes in API need fixes")


class TestYahoo:
Expand Down
6 changes: 0 additions & 6 deletions pandas_datareader/yahoo/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ class Options(_OptionBaseReader):

def get_options_data(self, month=None, year=None, expiry=None):
"""
***Experimental***
Gets call/put data for the stock with the expiration data in the
given month and year

Expand Down Expand Up @@ -184,7 +183,6 @@ def _get_option_data(self, expiry, name):

def get_call_data(self, month=None, year=None, expiry=None):
"""
***Experimental***
Gets call/put data for the stock with the expiration data in the
given month and year

Expand Down Expand Up @@ -254,7 +252,6 @@ def get_call_data(self, month=None, year=None, expiry=None):

def get_put_data(self, month=None, year=None, expiry=None):
"""
***Experimental***
Gets put data for the stock with the expiration data in the
given month and year

Expand Down Expand Up @@ -328,7 +325,6 @@ def get_near_stock_price(
self, above_below=2, call=True, put=False, month=None, year=None, expiry=None
):
"""
***Experimental***
Returns a DataFrame of options that are near the current stock price.

Parameters
Expand Down Expand Up @@ -506,7 +502,6 @@ def get_forward_data(
self, months, call=True, put=False, near=False, above_below=2
): # pragma: no cover
"""
***Experimental***
Gets either call, put, or both data for months starting in the current
month and going out in the future a specified amount of time.

Expand Down Expand Up @@ -573,7 +568,6 @@ def get_forward_data(

def get_all_data(self, call=True, put=True):
"""
***Experimental***
Gets either call, put, or both data for all available months starting
in the current month.

Expand Down