Skip to main content

U.S. Treasury connector for the parsimony framework

Project description

parsimony-treasury

US Treasury Fiscal Data connector plugin for parsimony — debt, revenue, spending, securities, and other federal fiscal datasets from the Bureau of the Fiscal Service.

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 as a tidy DataFrame, with optional filter, sort, and page size.
enumerate_treasury enumerator Enumerate every Treasury Fiscal Data dataset and endpoint for catalog indexing (drives the treasury catalog).

Install

pip install parsimony-treasury

Pulls in parsimony-core>=0.4,<0.5 automatically. Verify discovery:

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

Quick start

import asyncio
from parsimony_treasury import CONNECTORS

async def main():
    connectors = CONNECTORS.bind_env()
    result = await connectors["treasury_fetch"](
        endpoint="v2/accounting/od/debt_to_penny",
        sort="-record_date",
        page_size=10,
    )
    print(result.data.head())

asyncio.run(main())

For multi-plugin composition:

from parsimony import discover
connectors = discover.load_all().bind_env()

Catalog publishing

This plugin publishes a catalog under the treasury namespace, backed by enumerate_treasury (param-less; walks the Fiscal Data dataset metadata API).

parsimony publish --provider treasury --target "hf://<your-org>/parsimony-treasury"

The {namespace} placeholder in --target is substituted with treasury at publish time; targets support file://, hf://, and s3:// schemes.

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.4.0.tar.gz (15.1 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.4.0-py3-none-any.whl (15.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: parsimony_treasury-0.4.0.tar.gz
  • Upload date:
  • Size: 15.1 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.4.0.tar.gz
Algorithm Hash digest
SHA256 c8ed5e5700f8ea26aa42f852311bd082f44ac9254fa3534050caaaa94798f4e5
MD5 bc2e7a09b5af7c1725330a05beef8ac4
BLAKE2b-256 55d16d87f9ce245e9c2bf51679ae407cb9a58d56fa3b2a848d06a247a83fd527

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for parsimony_treasury-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 62b37c7c8d43e0a143da8330f11d38f9a5241033fe636e693cacc70fd94bd653
MD5 094f22c1c829c2e830a98a57105f862b
BLAKE2b-256 222b14f6cada081b1a6028a489c072cecd937eb8961c856321e0546554307068

See more details on using hashes here.

Provenance

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