Bank of Canada connector for the parsimony framework
Project description
parsimony-boc
Bank of Canada connector — Canadian exchange rates, interest/bond yields, money & credit aggregates, CPI, commodity price indices, and the data behind BoC publications, as numeric time series via the Valet API.
Part of the parsimony-connectors monorepo. Distributed standalone on PyPI as parsimony-boc.
Connectors
| Name | Kind | Description |
|---|---|---|
boc_fetch |
connector | Fetch one or more series by name (e.g. FXUSDCAD,FXEURCAD) or a whole panel by group (e.g. group:FX_RATES_DAILY). Reaches the entire universe by name. |
enumerate_boc |
enumerator | Catalog feed: one row per series (~15.6k) and one per live group (~2.4k), from Valet's list endpoints plus a per-group membership fan-out. |
boc_search |
connector | Search the published BoC catalog (lexical title or code:/structured). Pass returned codes to boc_fetch(series_name=...). |
Discovery model
The Valet API has no native keyword search, so discovery is a built catalog (archetype A — one live full-index call lists the whole universe):
GET /lists/series/jsonis the authoritative enumeration path (15,638 series, live 2026-06-09). It self-tracks BoC additions, so the catalog stays current on each rebuild.- Groups are first-class catalog entities. Each named panel (e.g.
FX_RATES_DAILY) gets its own row keyedgroup:NAME— the exact stringboc_fetchaccepts — because group descriptions carry retrieval signal no individual series has ("Month-end, Millions of dollars"). A fetch on agroup:code returns the whole panel in one request. - The per-group membership fan-out doubles as a liveness probe: ~29 retired one-off panels that 404 on every fetch path are pruned, so the catalog never offers a panel you cannot fetch.
Every series stays fetchable by name regardless of catalog coverage — the boundary is discovery, not access.
Install
pip install parsimony-boc
Pulls in a compatible parsimony-core automatically. Verify discovery:
python -c "from parsimony import discover; print([p.name for p in discover.iter_providers()])"
Configuration
No configuration required — the Valet API is open and unauthenticated.
boc_search reads published catalog snapshots (default root
hf://parsimony-dev/boc). Override with PARSIMONY_BOC_CATALOG_URL or
catalog_url= at call time; a missing snapshot is built on demand from the live
list endpoints and cached in an LRU.
Observations request limit. Valet caps the
/observationsrequest URL near 4096 bytes (roughly 100–160 comma-joined series, depending on name length).boc_fetchguards this pre-call and asks you to split the request or fetch a whole panel withgroup:NAME. The limit is on URL length, not series count.
Quick start
from parsimony_boc import CONNECTORS
# find a series (or a whole panel) in the catalog
hits = CONNECTORS["boc_search"](query="US dollar Canadian dollar exchange rate")
code = hits.data.iloc[0]["code"] # e.g. "FXUSDCAD" or "group:FX_RATES_DAILY"
# fetch observations
result = CONNECTORS["boc_fetch"](series_name=code, start_date="2024-01-01")
print(result.data.head())
For multi-plugin composition (autoloads everything installed):
from parsimony import discover
connectors = discover.load_all()
Catalog building
scripts/build_catalog.py builds the single boc catalog from the live list
endpoints and saves/pushes a snapshot:
uv run python packages/boc/scripts/build_catalog.py \
--save file:///tmp/parsimony-catalogs/boc --push hf://parsimony-dev/boc
Provider
- Homepage: https://www.bankofcanada.ca
- Valet API docs: https://www.bankofcanada.ca/valet/docs
- Terms: https://www.bankofcanada.ca/terms/ — free reuse with attribution to the Bank of Canada. Data is © Bank of Canada; this connector and its catalog are a derived index of series identifiers and titles.
License
See LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file parsimony_boc-0.0.1.tar.gz.
File metadata
- Download URL: parsimony_boc-0.0.1.tar.gz
- Upload date:
- Size: 16.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
03ed928b319059cdff0bc7a9ba14328ca38c0c579fa18aface49ff218686504c
|
|
| MD5 |
9b2e4d82263c71e992cb09b9f5ff1090
|
|
| BLAKE2b-256 |
535a591b86fd87aac32ec6ded43d37b333a4a6764b2f2b9227a3f3b806b0a36f
|
Provenance
The following attestation bundles were made for parsimony_boc-0.0.1.tar.gz:
Publisher:
release.yml on ockham-sh/parsimony-connectors
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
parsimony_boc-0.0.1.tar.gz -
Subject digest:
03ed928b319059cdff0bc7a9ba14328ca38c0c579fa18aface49ff218686504c - Sigstore transparency entry: 1971021878
- Sigstore integration time:
-
Permalink:
ockham-sh/parsimony-connectors@517cb5874f97ffede7738611ed75bb3ed27e26a0 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/ockham-sh
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@517cb5874f97ffede7738611ed75bb3ed27e26a0 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file parsimony_boc-0.0.1-py3-none-any.whl.
File metadata
- Download URL: parsimony_boc-0.0.1-py3-none-any.whl
- Upload date:
- Size: 18.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d3b2c0ea2c82ffb0b6b460d26d09ef5eabf4d7eb92ed8da9a7f8e947b07f7562
|
|
| MD5 |
3d732c5d66ddd78ce7534427d561ab0d
|
|
| BLAKE2b-256 |
10b4c35116f8d160e2cfb73578043b6effc7967b6d6d83e17589ff1c6e8a173c
|
Provenance
The following attestation bundles were made for parsimony_boc-0.0.1-py3-none-any.whl:
Publisher:
release.yml on ockham-sh/parsimony-connectors
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
parsimony_boc-0.0.1-py3-none-any.whl -
Subject digest:
d3b2c0ea2c82ffb0b6b460d26d09ef5eabf4d7eb92ed8da9a7f8e947b07f7562 - Sigstore transparency entry: 1971021944
- Sigstore integration time:
-
Permalink:
ockham-sh/parsimony-connectors@517cb5874f97ffede7738611ed75bb3ed27e26a0 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/ockham-sh
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@517cb5874f97ffede7738611ed75bb3ed27e26a0 -
Trigger Event:
workflow_dispatch
-
Statement type: