Skip to main content

U.S. Treasury (Fiscal Data + Office of Debt Management rate feeds) connector for the parsimony framework

Project description

parsimony-treasury

US Treasury connector plugin for parsimony — federal fiscal datasets (debt, revenue, spending, securities) from the Bureau of the Fiscal Service, plus the Office of Debt Management daily rate feeds (par yield curve, bill rates). Keyless — no API credentials required.

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

Connectors

Name Kind Description
treasury_fetch connector Fetch any Fiscal Data API endpoint (e.g. v2/accounting/od/debt_to_penny) as a DataFrame, with optional filter, sort, and page_size.
treasury_rates_fetch connector Fetch one Office of Debt Management rate feed (par yield curve, real yield curve, bill rates, long-term, real long-term) for a calendar year from the home.treasury.gov OData/Atom XML feed.
enumerate_treasury enumerator Enumerate every addressable Fiscal Data time-series measure plus the ODM rate-feed benchmarks for catalog indexing (drives the treasury catalog).
treasury_search connector Semantic-search the published treasury catalog and return matching code + title + score rows. Routing: home/<feed>treasury_rates_fetch; v<n>/<endpoint>#<field>treasury_fetch.

Install

pip install parsimony-treasury

Pulls in a compatible parsimony-core automatically. Verify discovery:

python -c "from parsimony import discover; print([p.name for p in discover.iter_providers()])"

Quick start

from parsimony_treasury import CONNECTORS

result = CONNECTORS["treasury_fetch"](
    endpoint="v2/accounting/od/debt_to_penny",
    sort="-record_date",
    page_size=10,
)
print(result.data.head())

For multi-plugin composition:

from parsimony import discover
connectors = discover.load_all()

Catalogs

This plugin ships a treasury catalog (~914 entries) driven by enumerate_treasury. treasury_search loads a published snapshot (overridable via the PARSIMONY_TREASURY_CATALOG_URL env var) and falls back to building one in-process when no snapshot is reachable. Maintainers build and push the snapshot with scripts/build_catalog.py.

Two enumeration sources:

  • Fiscal Data — self-tracking (archetype A). The live /services/dtg/metadata/ JSON (the same source the fiscaldata.treasury.gov site consumes) lists every dataset → endpoint → field in one call: 879 measure fields across 180 fetchable endpoints / 53 datasets (live count, 2026-06-09). A new dataset appears in the catalog automatically on the next build.
  • Office of Debt Management rate feeds — curated registry (archetype D). The 5 daily interest-rate feeds (par yield curve, real yield curve, bill rates, long-term, real long-term) are not in the metadata endpoint; their feed set is the stable interest-rate-statistics dropdown. scripts/harvest_rate_feeds.py cross-validates the registry's benchmark maturities against the live feed columns.

Coverage

Catalog covers ALL: yes (the metadata endpoint is the authoritative, self-tracking enumeration). Connectors cover ALL accessible data: partial by design — two documented exclusions:

  • 3 static-file-only datasetsMonthly Treasury Disbursements, Combined Statement, and Account of Receipts and Expenditures carry no queryable API endpoint (no endpoint_txt); they are published only as static files, so there is nothing to fetch via the JSON API.
  • Treasury Coupon Issues + HQM Corporate Bond Yield Curve — a separate product distributed as binary .xls 5-year archives (monthly, for Pension-Protection-Act actuarial use), not part of the daily XML feed family. The HQM spot-rate series are already available through the parsimony-fred connector (HQMCB20YR, etc.), so this connector defers to FRED for them.

Provider

License

See LICENSE.

Project details


Download files

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

Source Distribution

parsimony_treasury-0.0.1.tar.gz (20.0 kB view details)

Uploaded Source

Built Distribution

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

parsimony_treasury-0.0.1-py3-none-any.whl (24.0 kB view details)

Uploaded Python 3

File details

Details for the file parsimony_treasury-0.0.1.tar.gz.

File metadata

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

File hashes

Hashes for parsimony_treasury-0.0.1.tar.gz
Algorithm Hash digest
SHA256 037a453bd225f59bca495ba00d498980ed1c7b50003221b33af934150fa8a8a5
MD5 ad25cea7e2f0c4e9399c4d5ec91e000f
BLAKE2b-256 a3d252ee6ad3cd6e1b7c0f53e0975e2a6173a710e797bd672aafd43eaa669b91

See more details on using hashes here.

Provenance

The following attestation bundles were made for parsimony_treasury-0.0.1.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_treasury-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for parsimony_treasury-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b63675bf4752fdaddf84483ea8230531947a9d33ad116ef823f14fb01182b006
MD5 015335e57964183b05860806ef0a66a7
BLAKE2b-256 6047f555a3fcb6392bc6f01d69c669464f92ae38de3598747126213c8e735732

See more details on using hashes here.

Provenance

The following attestation bundles were made for parsimony_treasury-0.0.1-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.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page