feat: add openbb-government-ca extension — Statistics Canada SDMX catalog (Phase 1)#7548
Draft
rohanjethwani17 wants to merge 2 commits into
Draft
feat: add openbb-government-ca extension — Statistics Canada SDMX catalog (Phase 1)#7548rohanjethwani17 wants to merge 2 commits into
rohanjethwani17 wants to merge 2 commits into
Conversation
…ture) Signed-off-by: rohanjethwani17 <rohanjethwani17@gmail.com>
…/rohanjethwani17/7548
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this is
First phase of the
openbb-government-caextension discussed in #7490. This PR delivers the V5 package scaffold plus the Statistics Canada (StatsCan) SDMX catalog infrastructure, following the Hatchling formula from the openbb-oecd refactor (#7413):openbb_coreimport in the build env), gated byOPENBB_GOVERNMENT_CA_FORCE_CACHE_REBUILD, asset gitignored at the repo root alongside the OECD/IMF entriesrequestsonly) that digests per-PID SDMX-ML structure messages into a normalized catalogavailable_indicatorsdiscovery endpoint reading from the shipped catalogopenbb_government_capackage, with a CI workflow mirroringtest-unit-openbb-oecd.yml(ruff + ty + pytest,--cov-fail-under=100, across Linux/macOS/Windows on Python 3.10/3.11/3.13)This is opened as a draft — it's Phase 1 (catalog infrastructure). Phases to follow: StatsCan data fetchers + router (
obb.statscan.*), Bank of Canada Valet datasets (obb.boc.*— yield curves, open market operations, balance sheet), and topical surfacing (obb.economy.calendar,obb.economy.available_indicators).A few decisions I made that I'd value your read on
1. Curated catalog scope. StatsCan's full cube population is ~8,213 tables, which compresses to roughly 50–130 MB — too large to ship as an asset. I scoped the catalog to a curated seed of the 36 distinct table PIDs found in
ind-econ.json(results.indicators[].source), which produces a 47 KB compressed catalog (~317 KB decompressed) covering the headline economic indicators. Happy to widen the seed set if you'd prefer broader coverage.2. StatsCan diverges from the OECD SDMX assumptions. Worth flagging what the recon turned up, since it shaped the design:
structure/Data_Structure_{pid}.OBS_VALUEmeasure, common codelists), so one generic parser handles every table.TimeDimension(theTextFormatelement is empty in real responses) — it's carried as afreqannotation on theDataStructure. The parser reads it from there.3. The discovery endpoint is model-less.
available_indicatorsreturns a plainlist[dict]rather than flowing through the standard fetcher/OBBject/provider-choices machinery, since it's pure catalog metadata with no provider query. Core supports this and the route registers cleanly, but it's a different idiom than the model-backed discovery endpoints in CFTC/OECD/economy. If you'd prefer it go through the standardOBBjectpath, easy to change — wanted your call before building the rest of the endpoints on this pattern.Notes
undeterminedrather than guessed.feature/v5-government-caoffv5per your guidance. I know a direct PR tov5may hit branch protection — flagging in case you need to adjust anything upstream, as you mentioned.