Skip to content

Instantly share code, notes, and snippets.

$base = 'https://api.fiscaldata.treasury.gov/services/api/fiscal_service/v1/accounting/dts'
$rest_url = '/dts_table_2?filter=record_date:gte:{0},transaction_catg:eq:{1}&fields=record_date,transaction_type,transaction_catg,transaction_today_amt&page[number]=1&page[size]=300'
$date = '2023-01-01'
# ----------------------------------------------------------------------
# https://www.opm.gov/policy-data-oversight/pay-leave/federal-holidays/#url=2023
$base = 'https://api.fiscaldata.treasury.gov/services/api/fiscal_service/v1/accounting/dts'
$rest_url = '/dts_table_2?filter=record_date:gte:{0},transaction_catg:eq:{1}&fields=record_date,transaction_type,transaction_catg,transaction_today_amt&page[number]=1&page[size]=300'
$date = '2023-01-01'
$result_ssa = Invoke-RestMethod -Method Get -Uri ($base + $rest_url -f $date, 'SSA - Benefits Payments')
# stacked bar of marketable debt maturities per day stacked with bills,bonds,tips
#
# Idea from https://twitter.com/dampedspring
# Thanks to https://twitter.com/whip_n_spur for the help.
#
# Original thread: https://twitter.com/dampedspring/status/1652464875829084160
#
# https://twitter.com/dharmatrade/status/1652534712462884864
This file has been truncated, but you can view the full file.
record_date security_type_desc security_class1_desc security_class2_desc series_cd interest_rate_pct yield_pct issue_date maturity_date interest_pay_date_1 interest_pay_date_2 interest_pay_date_3 interest_pay_date_4 issued_amt inflation_adj_amt redeemed_amt outstanding_amt src_line_nbr record_fiscal_year record_fiscal_quarter record_calendar_year record_calendar_quarter record_calendar_month record_calendar_day
----------- ------------------ -------------------- -------------------- --------- ----------------- --------- ---------- ------------- ------------------- ------------------- ------------------- ------------------- ---------- ----------------- ------------ --------------- ------------ ------------------ --------------------- -------------------- ----------------------- --------------------- -------------------
2021-10-31 Marketable Floating Rate Notes 91282CBY6 null null 0.03 2021-05-28 2023-04-30 07/31 10/31
word count
---- -----
unto 9239
shall 9036
jehovah 6705
thou 5433
thy 4928
will 4111
ye 3969

TreasuryDirect data:

image

is showing the following for 2023-04-17:

issued:   96
maturing: 45
# https://www.ffiec.gov/npw/FinancialReport/ReturnBHCFZipFiles?zipfilename=BHCF20230331.ZIP
Write-Host 'Downloading...' -ForegroundColor Yellow -NoNewline
$result = Invoke-WebRequest -Uri 'https://www.ffiec.gov/npw/FinancialReport/ReturnBHCFZipFiles?zipfilename=BHCF20230331.ZIP' -OutFile BHCF20230331.ZIP
Write-Host 'done' -ForegroundColor Yellow
Expand-Archive -Path .\BHCF20230331.ZIP -Force
$result_bhcf = Import-Csv .\BHCF.csv
$result_rssd = Import-Csv .\RSSD.csv
Write-Host 'Importing CSV...' -ForegroundColor Yellow -NoNewline
$result = Import-Csv -Delimiter '^' -Path BHCF20221231.txt
Write-Host 'Done' -ForegroundColor Yellow