Skip to main content

Python Wrapper for using the US Fiscal Data API

Project description

US-FD-TreasuryPy

##Description This repository is an unofficial Python wrapper for the US Treasury Fiscial Data API. This api includes a substantial number of endpoints which I am continiously working to add. As of the offical version 1, this wrapper includes functions for Debt To Penny, Daily Treasury Statements, 120 Day Delinquent Debt Referral Compliance Report, Gold Reserve, Record Setting Auction, State and Local Government Series Securities (Non-Marketable), Treasury Report on Receivables (TROR), Schedules of Federal Debt by Day Activity and Schedules of Federal Debt by Day Summary.

#Usage from TreasuryPy import tp

ex: tp.get_debt_to_penny({})

When calling the dataset, a parameters dictionary must be passed into the function. The parameters dictionary can contain parameters which can provided added functionality such as filtering, sorting, and formatting.

The fields value take in a string list of column names The filters value take in a string list of column names with conditional opperator valid conditionals are: <, <=, >, >=, ==, === The pagination value takes in a dictionary with "number" and "size" corresponding to how many rows you want to return and at what position The sorting value takes in a dictionary with the key being the selected field and the value being increasing or decreasing The output value takes in a string of output types. The types are "csv", "json", "xml" At this current time only the json output works

parameters = { "fields" : ["foo", "bar"], "filters" : ["foo_bar==2023-06-30", "foo_bar<=20"],
"pagination" : { "number" : 1, "size" : 10 }, "sorting" : { "foo" : "increasing" }, "output" : "foo" }

tp.get_debt_to_penny({})

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

TreasuryPy-0.0.1.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

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

TreasuryPy-0.0.1-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: TreasuryPy-0.0.1.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for TreasuryPy-0.0.1.tar.gz
Algorithm Hash digest
SHA256 4eaaadd101c12d1b828c880f14ecb7c617f09e538d724e8d33f8bb9ef785e90d
MD5 cb8e1e4869d3be53dd6eb1871947e70d
BLAKE2b-256 875ba0a202e0b65c6b594aeda0aef3f9e3959600e84eefc4b1bdb4309ebe0c6a

See more details on using hashes here.

File details

Details for the file TreasuryPy-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: TreasuryPy-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 4.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for TreasuryPy-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f4d3448091dd1ba8fd72e58c3573a49aa4029e7d5d1c0c2990b43d0f07e1fab4
MD5 01cdf5c7afa51159b921c335dce2fe84
BLAKE2b-256 fb7baea9d994efd3666f91668ab33c05ec5769a93d20d256e25169035169a44f

See more details on using hashes here.

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