Skip to content

Commit 62b9c0e

Browse files
authored
Merge branch 'main' into main
2 parents 517260f + a1cf7a2 commit 62b9c0e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+595
-3073
lines changed

MANIFEST.in

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ include LICENSE.md
33
include requirements.txt
44
include requirements-dev.txt
55
include pandas_datareader/*.py
6-
76
include pandas_datareader/tests/*.py
87
include pandas_datareader/tests/data/*
9-
include versioneer.py
108
include pandas_datareader/_version.py

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ for the latest changes in master.
3838

3939
Using pandas datareader requires the following packages:
4040

41-
- pandas>=1.0
41+
- pandas>=1.5.3
4242
- lxml
4343
- requests>=2.19.0
4444

azure-pipelines.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,16 @@ trigger:
1313

1414
variables:
1515
PYTHONHASHSEED: 12345678
16-
SETUPTOOLS_USE_DISTUTILS: "stdlib"
1716
coverage: true
18-
RANDOMGEN_CYTHON_COVERAGE: true
1917

2018
jobs:
2119

2220
- template: ci/azure/azure_template_posix.yml
2321
parameters:
2422
name: Linux
25-
vmImage: ubuntu-20.04
23+
vmImage: ubuntu-latest
2624

2725
- template: ci/azure/azure_template_windows.yml
2826
parameters:
2927
name: Windows
30-
vmImage: windows-2019
28+
vmImage: windows-latest

ci/azure/azure_template_posix.yml

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,19 @@ jobs:
1616
vmImage: ${{ parameters.vmImage }}
1717
strategy:
1818
matrix:
19-
${{ if eq(parameters.name, 'Linux') }}:
20-
python36_legacy:
21-
python.version: '3.6'
22-
PANDAS: 1.0.5
23-
python37_legacy:
24-
python.version: '3.7'
25-
PANDAS: 1.1.5
26-
python38_recent:
27-
python.version: '3.8'
28-
PANDAS: 1.2.5
29-
python39_latest:
30-
python.version: '3.9'
31-
32-
# maxParallel: 10
19+
python38_legacy:
20+
python.version: '3.8'
21+
PANDAS: 1.5.3
22+
python39_legacy:
23+
python.version: '3.9'
24+
PANDAS: 1.5.3
25+
python310_recent:
26+
python.version: '3.9'
27+
PANDAS: 2.0.3
28+
python311_latest:
29+
python.version: '3.11'
30+
python312_latest:
31+
python.version: '3.12'
3332

3433
steps:
3534
- task: UsePythonVersion@0
@@ -41,14 +40,13 @@ jobs:
4140
python -m pip install pip setuptools -U
4241
python -m pip install -r requirements.txt
4342
python -m pip install -r requirements-dev.txt
44-
4543
if [[ -n ${PANDAS} ]]; then
4644
python -m pip install pandas==${PANDAS}
4745
fi;
4846
displayName: 'Install dependencies'
4947
5048
- script: |
51-
python -m pip install -e . -v --no-build-isolation
49+
python -m pip install -e . -vv
5250
displayName: 'Install'
5351
5452
- script: python -m pip list

ci/azure/azure_template_windows.yml

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,19 @@ jobs:
1616
vmImage: ${{ parameters.vmImage }}
1717
strategy:
1818
matrix:
19-
${{ if eq(parameters.name, 'Linux') }}:
20-
python37_legacy:
21-
python.version: '3.7'
22-
PANDAS: 1.0.5
23-
python38_legacy:
24-
python.version: '3.8'
25-
PANDAS: 1.1.5
26-
python38_recent:
27-
python.version: '3.8'
28-
PANDAS: 1.2.5
29-
python39_latest:
30-
python.version: '3.9'
31-
32-
# maxParallel: 10
19+
python38_legacy:
20+
python.version: '3.8'
21+
PANDAS: 1.5.3
22+
python39_legecy:
23+
python.version: '3.9'
24+
PANDAS: 1.5.3
25+
python310_recent:
26+
python.version: '3.10'
27+
PANDAS: 2.0.3
28+
python311_latest:
29+
python.version: '3.11'
30+
python312_latest:
31+
python.version: '3.12'
3332

3433
steps:
3534
- task: UsePythonVersion@0
@@ -42,13 +41,16 @@ jobs:
4241
python -m pip install -r requirements.txt
4342
python -m pip install -r requirements-dev.txt
4443
45-
if [[ -n ${PANDAS} ]]; then
46-
python -m pip install pandas==${PANDAS}
47-
fi;
4844
displayName: 'Install dependencies'
4945
46+
- powershell: |
47+
if ($null -ne $env:PANDAS) {
48+
python -m pip install pandas==${PANDAS}
49+
}
50+
displayName: 'Update pandas (if needed)'
51+
5052
- script: |
51-
python -m pip install -e . -v --no-build-isolation
53+
python -m pip install -e . -vv
5254
displayName: 'Install'
5355
5456
- script: python -m pip list

ci/pypi-install.sh

Lines changed: 0 additions & 17 deletions
This file was deleted.

docs/source/conf.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#!/usr/bin/env python3
2-
# -*- coding: utf-8 -*-
32
#
43
# pandas-datareader documentation build configuration file, created by
54
# sphinx-quickstart on Thu Jan 18 13:34:14 2018.
@@ -88,7 +87,7 @@
8887
#
8988
# This is also used if you do content translation via gettext catalogs.
9089
# Usually you set "language" from the command line for these cases.
91-
language = None
90+
language = "en"
9291

9392
# List of patterns, relative to source directory, that match files and
9493
# directories to ignore when looking for source files.
@@ -201,7 +200,7 @@
201200

202201

203202
# Example configuration for intersphinx: refer to the Python standard library.
204-
intersphinx_mapping = {"https://docs.python.org/": None}
203+
intersphinx_mapping = {"python": ("https://docs.python.org/3", None)}
205204

206205

207206
extlinks = {

docs/source/remote_data.rst

Lines changed: 53 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -305,12 +305,26 @@ for United States, is as simple as taking the ticker segment from the URL path
305305

306306
.. code-block:: ipython
307307
308-
import os
309-
import pandas_datareader.data as web
308+
In [1]: import os
310309
311-
f = web.DataReader('ticker=RGDPUS', 'econdb')
312-
f.head()
310+
In [2]: import pandas_datareader as pdr
313311
312+
In [3]: f = pdr.get_data_econdb('ticker=RGDPUS')
313+
In [4]: f.head()
314+
Out[4]:
315+
TableName T10106
316+
SeriesCode A191RX
317+
Table Table 1.1.6. Real Gross Domestic Product, Ch...
318+
Series description Gross domestic product
319+
CL_UNIT Level
320+
CL_FREQ Q
321+
Note Table 1.1.6. Real Gross Domestic Product, Ch...
322+
TIME_PERIOD
323+
2018-01-01 18437128
324+
2018-04-01 18565696
325+
2018-07-01 18699748
326+
2018-10-01 18733740
327+
2019-01-01 18835412
314328
315329
The code snippet for exporting the whole dataset, or its filtered down subset,
316330
can be generated by using the Export -> Pandas Python3 functionality
@@ -319,16 +333,47 @@ such as the Eurostat's `GDP and main components <https://www.econdb.com/dataset/
319333

320334
.. code-block:: ipython
321335
322-
import os
323-
import pandas_datareader.data as web
336+
In [1]: import os
324337
325-
df = web.DataReader('dataset=NAMQ_10_GDP&v=Geopolitical entity (reporting)&h=TIME&from=2018-05-01&to=2021-01-01&GEO=[AL,AT,BE,BA,BG,HR,CY,CZ,DK,EE,EA19,FI,FR,DE,EL,HU,IS,IE,IT,XK,LV,LT,LU,MT,ME,NL,MK,NO,PL,PT,RO,RS,SK,SI,ES,SE,CH,TR,UK]&NA_ITEM=[B1GQ]&S_ADJ=[SCA]&UNIT=[CLV10_MNAC]', 'econdb')
326-
df.columns
338+
In [2]: import pandas_datareader as pdr
339+
340+
In [3]: df = pdr.get_data_econdb('dataset=NAMQ_10_GDP&v=Geopolitical entity (reporting)'
341+
'&h=TIME&from=2018-05-01&to=2021-01-01'
342+
'&GEO=[UK,ES,IT,DE,FR,CH,AT]&NA_ITEM=[B1GQ]'
343+
'&S_ADJ=[SCA]&UNIT=[CLV10_MNAC]')
344+
In [4]: df.head()
345+
Out[4]:
346+
Frequency Quarterly ...
347+
Unit of measure Chain linked volumes (2010), million units of national currency ...
348+
Seasonal adjustment Seasonally and calendar adjusted data ...
349+
National accounts indicator (ESA10) Gross domestic product at market prices ...
350+
Geopolitical entity (reporting) Austria ... Switzerland
351+
TIME_PERIOD ...
352+
2018-07-01 83427 ... 181338
353+
2018-10-01 84268 ... 181767
354+
2019-01-01 84919 ... 182039
355+
2019-04-01 84476 ... 182848
356+
2019-07-01 84822 ... 183866
357+
358+
In both cases, metadata for the requested Econdb series or dataset
359+
is in the ``MultiIndex`` columns of the returned ``DataFrame``,
360+
and can be conveniently converted to a ``dict`` as demonstrated below
361+
362+
.. code-block:: ipython
363+
364+
In [5]: meta = df.columns.to_frame().iloc[0].to_dict() # first column, positionally
365+
Out[5]: meta
366+
{'Frequency': 'Quarterly',
367+
'Unit of measure': 'Chain linked volumes (2010), million units of national currency',
368+
'Seasonal adjustment': 'Seasonally and calendar adjusted data',
369+
'National accounts indicator (ESA10)': 'Gross domestic product at market prices',
370+
'Geopolitical entity (reporting)': 'Austria'}
327371
328372
Datasets can be located through Econdb's `search <https://www.econdb.com/search>`__
329373
engine, or discovered by exploring the `tree <https://www.econdb.com/tree/>`__
330374
of available statistical sources.
331375

376+
332377
.. _remote_data.enigma:
333378

334379
Enigma

pandas_datareader/__init__.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
import os
22
import sys
33

4-
from ._version import get_versions
4+
from ._version import __version__
55
from .data import (
66
DataReader,
77
Options,
88
get_components_yahoo,
99
get_dailysummary_iex,
1010
get_data_alphavantage,
11+
get_data_econdb,
1112
get_data_enigma,
1213
get_data_famafrench,
1314
get_data_fred,
@@ -32,12 +33,10 @@
3233

3334
PKG = os.path.dirname(__file__)
3435

35-
__version__ = get_versions()["version"]
36-
del get_versions
37-
3836
__all__ = [
3937
"__version__",
4038
"get_components_yahoo",
39+
"get_data_econdb",
4140
"get_data_enigma",
4241
"get_data_famafrench",
4342
"get_data_yahoo",

pandas_datareader/_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ def _sanitize_dates(start, end):
4646
try:
4747
start = to_datetime(start)
4848
end = to_datetime(end)
49-
except (TypeError, ValueError):
50-
raise ValueError("Invalid date format.")
49+
except (TypeError, ValueError) as exc:
50+
raise ValueError("Invalid date format.") from exc
5151
if start > end:
5252
raise ValueError("start must be an earlier date than end")
5353
return start, end

0 commit comments

Comments
 (0)