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.5.0.tar.gz (15.3 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.5.0-py3-none-any.whl (15.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: parsimony_treasury-0.5.0.tar.gz
  • Upload date:
  • Size: 15.3 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.5.0.tar.gz
Algorithm Hash digest
SHA256 fda9ac3a0f48e0dfe5d1b276d6a596baebeedac0f6dfe4908a6e5d72a83ea825
MD5 a145549306a5de20e473d50236d4ac44
BLAKE2b-256 bddfa159d81b302bd938b1ac5c2d344e2696ca0901b37be1b46ab4c18aba07c1

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for parsimony_treasury-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bbfffbb5cb78a2973ead4eb83369b60584bbefb267d81c7cb34439b76d5741cd
MD5 44b9ae198729826bf993a923ddb7a781
BLAKE2b-256 46b1a8022884b6098e78d3dbdbb0fe4cf065050e6a4c8c21193c8447d1eee56d

See more details on using hashes here.

Provenance

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