Bank of Japan connector for the parsimony framework
Project description
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_search → boj_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.xlsxDB_Namesheet — both agree exactly.scripts/harvest_databases.pyregenerates it (--diffchecks for drift). - A live per-database
getMetadatafan-out (the B part).getMetadatais uncapped — one call returns every series in a database (theCO/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-core 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_fetchaccepts 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_fetchpaginates over that limit automatically (via the API'sNEXTPOSITIONcursor), 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.data.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.data.iloc[0]["code"] # e.g. "FXERD01"
# fetch observations
result = CONNECTORS["boj_fetch"](db=db, code=code, start_date="202401")
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 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
- Homepage: https://www.boj.or.jp
- API manual: https://www.stat-search.boj.or.jp/info/api_manual_en.pdf
- Terms: https://www.stat-search.boj.or.jp/info/api_notice_en.pdf — public reuse with attribution to the Bank of Japan. 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_boj-0.0.1.tar.gz.
File metadata
- Download URL: parsimony_boj-0.0.1.tar.gz
- Upload date:
- Size: 23.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8c56f57c09d7580b8bc9e29f4a8c56bab0f8018086af8655d048117facc2d42c
|
|
| MD5 |
3922951141d9057f1b7b0c00b295edac
|
|
| BLAKE2b-256 |
6cb426af61c6ad8d3af9a963850d9ed1bbaa23f270ab8f253948256df436df1d
|
Provenance
The following attestation bundles were made for parsimony_boj-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_boj-0.0.1.tar.gz -
Subject digest:
8c56f57c09d7580b8bc9e29f4a8c56bab0f8018086af8655d048117facc2d42c - Sigstore transparency entry: 1971021827
- 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_boj-0.0.1-py3-none-any.whl.
File metadata
- Download URL: parsimony_boj-0.0.1-py3-none-any.whl
- Upload date:
- Size: 26.7 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 |
39e397fcb1ef9ea6c342165d2420cdcf507f321a2097a64773bda8368844c3aa
|
|
| MD5 |
3a577fe85fa8463083a7e154337e1b66
|
|
| BLAKE2b-256 |
d97d3d0b692fba020339ede2dd61bc925c5e3a3498a9b45e901047b7db21e61e
|
Provenance
The following attestation bundles were made for parsimony_boj-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_boj-0.0.1-py3-none-any.whl -
Subject digest:
39e397fcb1ef9ea6c342165d2420cdcf507f321a2097a64773bda8368844c3aa - Sigstore transparency entry: 1971021901
- 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: