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.

Metadata

Release files for parsimony-boc 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for parsimony-boc 0.0.2
File Size Uploaded Provenance
parsimony_boc-0.0.2.tar.gz 16.9 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for parsimony-boc 0.0.2
File Interpreter ABI Platform
parsimony_boc-0.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 36.1 kB

Release files / parsimony_boc-0.0.2.tar.gz

Download URL parsimony_boc-0.0.2.tar.gz
Size 16.9 kB
Tags Source
SHA-256 checksum
How to use checksums
08dfb86b94102144dc9e469f621c07268a076a8904f600777e0df2f24ddb45f4
BLAKE2b-256 checksum
How to use checksums
5cf81d3309f5dc50cf69b85d34a20ced8b03d3a6c3fae5de29561b79b02a3b13
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 10, 2026.

Transparency log

Release files / parsimony_boc-0.0.2-py3-none-any.whl

Download URL parsimony_boc-0.0.2-py3-none-any.whl
Size 19.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a43e99f5479591853d36bbc7cdcc5019dee9337e05d14e7458947839b76f9239
BLAKE2b-256 checksum
How to use checksums
02aa079370669fd3566f169bdf0ea1d76f613beb1ea6d8795be0847d5e216706
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 10, 2026.

Transparency log

Security for parsimony-boc 0.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for parsimony_boc-0.0.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 10, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files Full provenance

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