Skip to content

Add generated dataset catalog (CATALOG.md + build_catalog.py) - #19

Merged
mmcky merged 2 commits into
mainfrom
catalog/generated-registry
Jul 17, 2026
Merged

Add generated dataset catalog (CATALOG.md + build_catalog.py)#19
mmcky merged 2 commits into
mainfrom
catalog/generated-registry

Conversation

@mmcky

@mmcky mmcky commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Generated dataset catalog (PLAN Phase 2)

Realises the PLAN Phase 2 item "index/catalog page from the manifests — doubles as the dataset registry", as a durable in-repo registry of what has been migrated.

Approach: generated, not hand-maintained

The per-dataset manifests (lectures/*.yml) stay the single source of truth. scripts/build_catalog.py reads them and emits CATALOG.md — so the catalog cannot drift from the manifests (the same derive-don't-duplicate principle behind the #15 cutover tracker). Regenerate on any manifest change; a Phase 5 CI check will assert currency with git diff --exit-code CATALOG.md, failing the build if someone edits a manifest without regenerating.

What it shows

One row per migrated dataset: class, source (linked), licence + redistribution, integrity (upstream.status), builder status, size, and consumers — the lectures that use it, linked to each file. It deliberately surfaces the honest gaps AGENTS.md says the catalog should show: unverifiable upstream integrity, the countries.csv restricted licence (tracked in QuantEcon/workspace-lectures#20), and unrecovered builders.

Scope: migrated-only

A dataset appears once it has a manifest — currently the 4 migrated in the pilot (P1 lingcod + the P2 pandas_panel trio). Files in lectures/ without a manifest are not yet migrated and stay tracked in PLAN Phase 9; they'll appear here automatically as their manifests land. Later feeds the Pages index (Phase 4).

Part of QuantEcon/meta#338; registry surface for QuantEcon/QuantEcon.manual#108.

Realises PLAN Phase 2's "index/catalog page from the manifests — doubles as the
dataset registry". Migrated-only scope: a dataset appears once it has a manifest.

- scripts/build_catalog.py reads lectures/*.yml and emits CATALOG.md — one row
  per dataset with class, source, licence + redistribution, integrity status,
  builder status, size and consumers (which lectures use it, linked). Generated,
  not hand-maintained, so it cannot drift from the manifests; a Phase 5 CI check
  will assert currency via `git diff --exit-code CATALOG.md`.
- CATALOG.md — first generation: the 4 migrated datasets (P1 lingcod + P2
  pandas_panel trio). Surfaces the honest gaps AGENTS.md promises the catalog
  shows: unverifiable upstream integrity, the countries.csv restricted licence
  (tracked in QuantEcon/workspace-lectures#20), and unrecovered builders.
- requirements.txt: add PyYAML for the parser.
- PLAN.md: tick the Phase 2 catalog item.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 17, 2026 01:43

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Implements PLAN Phase 2’s “generated catalog / dataset registry” by adding a generator script that derives CATALOG.md from the authoritative per-dataset manifests in lectures/*.yml, keeping the registry in sync with migrated datasets.

Changes:

  • Add scripts/build_catalog.py to generate a migrated-only dataset catalog from sidecar manifests.
  • Add CATALOG.md as the generated output (and update PLAN.md to mark Phase 2 catalog complete).
  • Add PyYAML to requirements.txt to support manifest parsing.

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.

File Description
scripts/build_catalog.py New generator that reads lectures/*.yml manifests and emits a Markdown registry (CATALOG.md).
requirements.txt Adds PyYAML dependency required by the catalog builder script.
PLAN.md Marks Phase 2 catalog work as complete and documents the generator + intended CI check.
CATALOG.md Generated catalog output committed for the current set of migrated datasets.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread scripts/build_catalog.py Outdated
Comment thread scripts/build_catalog.py Outdated
Copilot review (data-lectures#19): Path.open()/write_text() used the platform
default encoding. Manifests carry non-ASCII (en-dashes, curly quotes) and the
catalog emits Unicode marks (checkmark/warning), so on a non-UTF-8 locale (e.g.
Windows cp1252) reads/writes could raise UnicodeDecode/EncodeError. This script
is headed for CI where the runner locale is not guaranteed. No output change on
UTF-8 systems.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@mmcky
mmcky merged commit bcbe5d0 into main Jul 17, 2026
1 check passed
@mmcky
mmcky deleted the catalog/generated-registry branch July 17, 2026 02:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants