Banco de Portugal connector for the parsimony framework
Project description
parsimony-bdp
Banco de Portugal connector — Portuguese macroeconomic, monetary, financial, and external time series via the BPstat (JSON-stat) API.
Part of the parsimony-connectors monorepo. Distributed standalone on PyPI as parsimony-bdp.
Connectors
| Name | Kind | Description |
|---|---|---|
bdp_fetch |
connector | Fetch Banco de Portugal observations by domain_id + dataset_id (optional series_ids filter and date window). |
enumerate_bdp |
enumerator | Crawl the full BPstat universe (~72 K series across 212 datasets / 65 leaf domains) for catalog discovery. |
bdp_search |
connector | Semantic-search the published BdP catalog snapshot; returns ranked series codes. |
Install
pip install parsimony-bdp
Pulls in parsimony-core>=0.7,<0.8 automatically. Verify discovery:
python -c "from parsimony import discover; print([p.name for p in discover.iter_providers()])"
Configuration
No configuration required — the BPstat API is open and unauthenticated.
bdp_search reads a published catalog snapshot (default hf://parsimony-dev/bdp).
Override the snapshot location with the PARSIMONY_BDP_CATALOG_URL environment
variable, or pass catalog_url= at call time.
Quick start
from parsimony_bdp import CONNECTORS
# Discover via bdp_search, then fetch. A search hit's code splits as
# domain_id:dataset_id:series_id.
hits = CONNECTORS["bdp_search"](query="economic activity coincident indicator")
code = hits.data.iloc[0]["code"] # e.g. "48:aea9…:12099329"
domain_id, dataset_id, series_id = code.split(":")
result = CONNECTORS["bdp_fetch"](
domain_id=int(domain_id), dataset_id=dataset_id, series_ids=series_id
)
print(result.data.head())
For multi-plugin composition (autoloads everything installed):
from parsimony import discover
connectors = discover.load_all()
Catalogs
BPstat has no flat "list all series" endpoint, so enumerate_bdp walks the
domain → dataset → series hierarchy. Two things make the crawl both complete
and cheap: it paginates the datasets list (domains with >10 datasets would
otherwise lose series), and it crawls each dataset at page_size=100&obs_last_n=1
(100 series per page with a one-point observation array) — about 720 lean pages
for the whole universe. Each dataset is self-checked against its declared series
count. Maintainers then run a bilingual /series/ enrichment pass (English +
Portuguese descriptions folded into the catalog description for cross-language
recall), build a Catalog snapshot (scripts/build_catalog.py), and push it to
the snapshot URL bdp_search reads — the build runs offline as a publish job,
never at query time.
Provider
- Homepage: https://www.bportugal.pt
- BPstat portal: https://bpstat.bportugal.pt
- API docs: https://bpstat.bportugal.pt/data/docs
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_bdp-0.0.1.tar.gz.
File metadata
- Download URL: parsimony_bdp-0.0.1.tar.gz
- Upload date:
- Size: 19.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 |
faf3248653aea15ab7011a30833fb7084dcbcaabb1740627ed1a1642d790ba7f
|
|
| MD5 |
c3158d65297ca25f186441fa67a1858f
|
|
| BLAKE2b-256 |
66d2a36e66ff453cab08e476d2c936a832fd00142ae0da12f403c5f37c208885
|
Provenance
The following attestation bundles were made for parsimony_bdp-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_bdp-0.0.1.tar.gz -
Subject digest:
faf3248653aea15ab7011a30833fb7084dcbcaabb1740627ed1a1642d790ba7f - Sigstore transparency entry: 1971019684
- 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_bdp-0.0.1-py3-none-any.whl.
File metadata
- Download URL: parsimony_bdp-0.0.1-py3-none-any.whl
- Upload date:
- Size: 22.8 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 |
414afff22f5226245a72fcb599fefcccec3bf014ea2bbe8398694a9bdcf266ea
|
|
| MD5 |
8389bdb71484be91f0f81c18ea8bdf51
|
|
| BLAKE2b-256 |
6acadd49989a2efa7f2548038bba1564313d65eb15a88e178508ecda1dd80792
|
Provenance
The following attestation bundles were made for parsimony_bdp-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_bdp-0.0.1-py3-none-any.whl -
Subject digest:
414afff22f5226245a72fcb599fefcccec3bf014ea2bbe8398694a9bdcf266ea - Sigstore transparency entry: 1971019750
- 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: