Skip to main content

parsimony-boj

Bank of Japan connector — Japanese interest rates, FX, money & deposits, flow of funds, TANKAN, prices (CGPI/SPPI), balance of payments and BIS-related statistics, as numeric time series via the BOJ Time-Series Data Search API.

Part of the parsimony-connectors monorepo. Distributed standalone on PyPI as parsimony-boj.

Connectors

Name Kind Description
boj_databases_search connector Step 1. Search the 50 statistics databases; returns a db code (e.g. FM08) and the series_namespace for step 2.
boj_series_search connector Step 2. Search series within one database (db=…); returns code + db for boj_fetch.
boj_fetch connector Fetch observations by database + series code(s) (e.g. db=FM08, code=FXERD01,FXERD04). Max 250 codes; large requests are paginated transparently.
enumerate_boj enumerator Catalog feed: one row per series (~326k) and one per database (50), from a per-DB getMetadata fan-out.

Discovery chain: boj_databases_searchboj_series_search(db=...)boj_fetch.

Discovery model

BoJ has no native keyword search, so discovery is a built catalog. The API also exposes no way to list its databases (getMetadata requires a db), so the universe is enumerated two ways (archetype C + B):

  • A frozen 50-database registry (the C part). The list is transcribed from the official API manual and cross-validated against the machine-readable api_tool.xlsx DB_Name sheet — both agree exactly. scripts/harvest_databases.py regenerates it (--diff checks for drift).
  • A live per-database getMetadata fan-out (the B part). getMetadata is uncapped — one call returns every series in a database (the CO/TANKAN database alone is 166,513 series) — so each per-DB series catalog is complete.

The published catalog is multi-bundle: a boj_databases bundle (the 50 DBs) plus one boj_series_<db> bundle per database, built lazily and LRU-cached. This two-tier shape (like parsimony-bls) keeps each namespace tractable for the 326k-series universe. Every series is fetchable by (db, code) regardless of catalog coverage — the boundary is discovery, not access.

Install

pip install parsimony-boj

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 BOJ API is open and unauthenticated.

The search connectors read published catalog snapshots (default root hf://parsimony-dev/boj). Override with PARSIMONY_BOJ_CATALOG_URL or catalog_root= at call time; a missing snapshot is built on demand from the live metadata and cached in an LRU.

Request limits. boj_fetch accepts up to 250 series codes per call, all of the same frequency (a BoJ rule). The API also caps each response at 60,000 data points (series × periods); boj_fetch paginates over that limit automatically (via the API's NEXTPOSITION cursor), so a large multi-series request returns its full result rather than a silent truncation.

Quick start

from parsimony_boj import CONNECTORS

# step 1: find the database
dbs = CONNECTORS["boj_databases_search"](query="foreign exchange rates")
db = dbs.raw.iloc[0]["db"]  # e.g. "FM08"
# step 2: find a series within it
hits = CONNECTORS["boj_series_search"](query="US dollar spot", db=db)
code = hits.raw.iloc[0]["code"]  # e.g. "FXERD01"
# fetch observations
result = CONNECTORS["boj_fetch"](db=db, code=code, start_date="202401")
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 multi-bundle catalog from the live metadata and saves/pushes snapshots:

uv run python packages/boj/scripts/build_catalog.py \
  --catalog all --save-root file:///tmp/parsimony-catalogs/boj --push-root hf://parsimony-dev/boj

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_boj-0.0.2.tar.gz (24.6 kB view details)

Uploaded Source

Built Distribution

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

parsimony_boj-0.0.2-py3-none-any.whl (27.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for parsimony_boj-0.0.2.tar.gz
Algorithm Hash digest
SHA256 f84c603159805794b9514c4dbdb7458cfda8a5b61bbce5a1596497c9283ebc52
MD5 91010a55726fd8beb65bfe31535ba513
BLAKE2b-256 3e799f5f7ec4a31976117846aaab2d43297e9a682344d8cee72b28def5ec17c9

See more details on using hashes here.

Provenance

The following attestation bundles were made for parsimony_boj-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_boj-0.0.2-py3-none-any.whl.

File metadata

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

File hashes

Hashes for parsimony_boj-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 24d958aa99361828473f629088d63d91f9720319a517e5d8e582c9d3d8e75ef5
MD5 41ba1ce2764e8c8690225d8ea41c19a6
BLAKE2b-256 81bc39d87e211ae35b481d0315f79b4c58407de840c13af1c834b6714b1f633a

See more details on using hashes here.

Provenance

The following attestation bundles were made for parsimony_boj-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