Skip to main content

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 (literal query=; exact ids via filter=). 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/json is 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 keyed group:NAME — the exact string boc_fetch accepts — because group descriptions carry retrieval signal no individual series has ("Month-end, Millions of dollars"). A fetch on a group: 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 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 /observations request URL near 4096 bytes (roughly 100–160 comma-joined series, depending on name length). boc_fetch guards this pre-call and asks you to split the request or fetch a whole panel with group: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.raw.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.raw.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

License

See LICENSE.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

parsimony_boc-0.0.2.tar.gz (16.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

parsimony_boc-0.0.2-py3-none-any.whl (19.1 kB view details)

Uploaded Python 3

File details

Details for the file parsimony_boc-0.0.2.tar.gz.

File metadata

  • Download URL: parsimony_boc-0.0.2.tar.gz
  • Upload date:
  • Size: 16.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for parsimony_boc-0.0.2.tar.gz
Algorithm Hash digest
SHA256 08dfb86b94102144dc9e469f621c07268a076a8904f600777e0df2f24ddb45f4
MD5 e23c9056cf68e6456c34d8399c87207e
BLAKE2b-256 5cf81d3309f5dc50cf69b85d34a20ced8b03d3a6c3fae5de29561b79b02a3b13

See more details on using hashes here.

Provenance

The following attestation bundles were made for parsimony_boc-0.0.2.tar.gz:

Publisher: release.yml on ockham-sh/parsimony-connectors

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file parsimony_boc-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: parsimony_boc-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 19.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for parsimony_boc-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a43e99f5479591853d36bbc7cdcc5019dee9337e05d14e7458947839b76f9239
MD5 edcfcb8437faf137e4cc993e5eaecd22
BLAKE2b-256 02aa079370669fd3566f169bdf0ea1d76f613beb1ea6d8795be0847d5e216706

See more details on using hashes here.

Provenance

The following attestation bundles were made for parsimony_boc-0.0.2-py3-none-any.whl:

Publisher: release.yml on ockham-sh/parsimony-connectors

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 files

0.0.1

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page