Skip to content

pandas_datareader is maintained again (0.11.0/0.11.1, June 2026) — reconsider it as the builder-side entry point for dynamic data #26

Open

Description

@mmcky

What changed

pandas-datareader had been effectively unmaintained since 0.10.0 in July 2021. That is no longer true — two releases landed in June 2026:

Version Date What
0.11.0 2026-06-23 pandas 3 compatibility; new pandas_datareader.macro API
0.11.1 2026-06-24 fix to OECDReader for large mostly-empty frames

Two parts of 0.11.0 matter here.

pandas 3 compatibility. It vendored deprecate_kwarg to drop the dependency on the private pandas.util._decorators module — the exact failure recorded in QuantEcon/lecture-python.myst#924, which blocked the anaconda 2026.06 upgrade. That incompatibility was the concrete reason the package was on its way out.

A unified macro API. 0.11.0 adds pandas_datareader.macro, described in the release notes as providing "unified access to FRED, Eurostat, and OECD macro datasets via read_macro, search_macro_datasets, and describe_*".

Why this is a question for this repo

The second point is a candidate answer to something PLAN Phase 5 and Phase 8 P4 already need: a single consistent fetch layer for dynamic macro series, living in a builder rather than in lecture notebooks.

Phase 8 P4 is UNRATE — "consumed today by 4 lectures across 3 repos via 2 access methods" — and it is the pilot that establishes the dynamic template plus the documented live-call ↔ snapshot switch. pandas_datareader.macro covers FRED, Eurostat and OECD behind one interface, which would make a builder's fetch stage uniform across sources instead of one client per source.

Note the direction this implies: pandas_datareader moves out of lecture runtime and into scripts/. As a builder dependency it runs on a cadence, its failures surface in the Phase 5 sources-alive canary instead of in seven lecture repos' CI — which is exactly the relocation Phase 5 sets out to achieve — and lectures read a stable URL.

Current usage, for the record

Ten published lectures across four repos reference it. Six genuinely use it; four carry an install line they never import — see the note below the table.

Repo Lecture Reference Used?
lecture-python.myst unemployment_linear !pip install pandas_datareader; from pandas_datareader import data as web yes
lecture-python.myst unemployment_shocks combined !pip install numpyro jax pandas_datareader arviz; same import yes
lecture-python.myst phillips_lost_conquest !pip install pandas_datareader; same import yes
lecture-python.myst phillips_two_stories !pip install pandas_datareader; same import yes
lecture-python-intro business_cycle !pip install pandas-datareader; import pandas_datareader.data as web, alongside wbgapi yes
lecture-python-intro networks !pip install pandas-datareader only no
lecture-python-intro input_output !pip install pandas-datareader only no
lecture-python-advanced.myst doubts_or_variability !pip install pandas-datareader only no
lecture-datascience.myst tools/classification import pandas_datareader.data as web (pip dep in environment.yml) yes
lecture-datascience.myst tools/visualization_rules from pandas_datareader import DataReader (same) yes

Four of the ten are vestigial installs — networks, input_output and doubts_or_variability install the package and never import it. doubts_or_variability is the instructive one: a comment at line 2013 records that it deliberately avoids pandas-datareader by reading FRED's CSV endpoint directly, so the migration was done and only the install line was left behind. These four can be deleted with no code change, independent of whatever is decided below.

Of the six real usages, five are FRED readers. business_cycle is the one already half-migrated to wbgapi, and is also the lecture behind this repo's single existing dynamic snapshot (business_cycle_data.csv).

lecture-python.myst and lecture-python-intro are both on anaconda=2026.07 (pandas 3.x), and all four lecture-python.myst pages publish clean with no tracebacks — consistent with 0.11.0 working under pandas 3. lecture-datascience.myst is still on anaconda=2024.06 and carries pandas-datareader as an explicit pip dependency in environment.yml.

Questions

  • Does pandas_datareader.macro become the standard fetch layer for dynamic snapshots, or do we keep per-source clients (wbgapi, fredapi) and treat this as one option among several?
  • Should P4's UNRATE builder be written against it, making the pilot the test of this decision?
  • Does the live-call ↔ snapshot switch keep a live pandas_datareader path available inside lectures at all, or is snapshot-only the target?

Related

Activity

  1. mmcky commented on Jul 29, 2026

    @mmcky
    ContributorAuthor

    Correction to the inventory above. The table originally said seven lectures across three repos. It is ten across four — the first pass searched for pandas_datareader (underscore) and missed the lectures that write it hyphenated in their !pip install line. The body has been updated; the three additions are networks and input_output in lecture-python-intro, and doubts_or_variability in lecture-python-advanced.myst, a repo previously reported as clean.

    The correction sharpens rather than weakens the case. Four of the ten never import the package at all — they only install it. doubts_or_variability is the clearest case: a comment in that lecture records that it deliberately avoids pandas-datareader in favour of FRED's CSV endpoint, so the migration already happened there and only the install line survives. Those four lines can be removed with no code change and no dependency on the questions below.

  2. mmcky commented on Aug 6, 2026

    @mmcky
    ContributorAuthor

    Recommendation: split this into three questions — one is free today, one is a clear yes, one is a "not yet"

    Re-verified the inventory against current origin/main of all four repos today (2026-08-06). The three vestigial installs are all still there — networks and input_output in lecture-python-intro, doubts_or_variability in lecture-python-advanced.myst each carry a pip install pandas-datareader line with no matching import, while the five real users (business_cycle, unemployment_linear, unemployment_shocks, phillips_lost_conquest, phillips_two_stories) have both.

    The three questions at the bottom of this issue have different answers, and bundling them is what makes this feel undecidable.

    1. Delete the vestigial installs — do this now, independent of everything else

    Three lecture pages install a package they never import. doubts_or_variability is the instructive one: it carries an in-lecture comment recording that it deliberately reads FRED's CSV endpoint instead, so the migration already happened and only the install line survived. Removing these three lines is a no-op for output, shrinks three build environments, and needs no decision from the questions below. It should not wait for P4.

    2. Move pandas_datareader out of lecture runtime — yes, unambiguously

    This is the part PLAN.md Phase 5 already commits to and this issue frames correctly: a fetch that runs on a cadence in scripts/, whose failures surface in one canary rather than in seven lecture repos' CI, and lectures read a stable URL. Nothing here depends on which client the builder uses. AGENTS.md states the principle already — live API calls are for teaching data access, not for getting data.

    3. Make pandas_datareader.macro the standard fetch layer — not yet, and probably not for UNRATE

    Recommending no to standardising, for three reasons.

    The four-stage contract is already the standard, and it is the right level. fetch() returns raw, preprocess() is pure, validate() reads the manifest. That interface is what makes builders uniform and swappable; mandating a specific client underneath adds no uniformity the contract does not already provide, and a fetch stage is typically five lines. Standardising the library rather than the interface buys little and constrains a lot.

    The maintenance history argues for keeping the blast radius small. The package was effectively unmaintained from July 2021 to June 2026. Two releases in one week in June 2026 is genuinely good news and worth acting on — but it is not yet a track record. Making it the mandatory entry point for every dynamic dataset re-creates the single-point fragility Phase 5 exists to remove, just relocated from seven repos into one chokepoint. QuantEcon/lecture-python.myst#924 is the reminder of what that costs when it breaks.

    For UNRATE specifically there is a lower-risk option with in-repo precedent. A cron builder fetching one FRED series needs a plain HTTP GET against fredgraph.csv — no dependency, no wrapper, no version surface. That is exactly the migration doubts_or_variability already made on purpose, and lecture-python-programming's pandas/polars lessons already teach the same endpoint. Writing P4 against read_macro would be adding a dependency to replace a URL.

    Where pandas_datareader.macro would earn its place: a builder that genuinely needs many series across FRED and Eurostat and OECD with one normalised frame. No current or planned dataset does — the FRED incidental set in the migration plan's Wave 7 is FRED-only. Worth revisiting the moment a multi-source builder is actually on the table, and this issue is the right place to keep that open.

    4. Does the live path stay in lectures?

    Keep it exactly where the fetch is the lesson — lecture-python-programming's pandas and polars — and nowhere else. Those two are annotated pedagogy: lesson in the audit for precisely this reason and should keep calling live APIs, because the call is the content. For the fifteen incidental and mixed lectures, the target is snapshot-only with the live call shown but not executed, which is the switch mechanism P4 has to document.

    Effect on QuantEcon/meta#160

    That issue's premise — "last released 2021, maintainer not inclined to maintain the readers" — is now factually out of date and it should be re-read against this before anyone acts on it. But the recommendation above does not resurrect the package as a lecture dependency either: items 1 and 2 still reduce its footprint substantially. The two issues are compatible.

    Related: #14 (the builder contract these fetch stages implement) and the P4 work in PLAN.md Phase 8.

  3. mmcky commented on Sep 1, 2026

    @mmcky
    ContributorAuthor

    Decided and acted on, 2026-09-01 — all three questions from the recommendation above.

    1. The vestigial installs — done. lecture-python-intro dropped networks and input_output's lines in QuantEcon/lecture-python-intro#803; the last one, doubts_or_variability, is QuantEcon/lecture-python-advanced.myst#381.

    2. pandas_datareader out of lecture runtime — yes, and the mechanism now exists. The refresh-as-PR workflow and weekly canary landed in #110; the first FRED snapshots built on it are in #114.

    3. Not pandas_datareader.macro — a shared library of our own, and one builder per source. #114 adds builders/_fred.py, a Fred class over fredgraph.csv (fred.series('UNRATE'), fred.frame([...]), server-side frequency change, the observation_date → DATE rename), so a FRED builder's fetch stage is one line and its validate() is the only thing worth reading. The first user is builders/business_cycle_fred.py, which writes the intro business_cycle lecture's six FRED series as one composite monthly file — one file per source rather than one per series, because six URLs in a lecture is what makes it hard to read, and the composite's columns are the lecture's own variable names. Testing stays obvious: the class is testable alone, and each builder's contract is a single validate().

    4. The live path stays where the fetch is the lesson — lecture-python-programming's pandas and polars, and now explicitly lecture-python-intro's business_cycle (decided today: intro keeps every live call; lecture-wasm, which cannot make them, reads the snapshots — QuantEcon/lecture-wasm#70).

    pandas_datareader.macro remains worth revisiting the day a builder genuinely needs FRED and Eurostat and OECD in one frame; none does yet. Leaving this open only for that — say the word and I'll close it as decided.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions