Skip to content

Instantly share code, notes, and snippets.

View issued-maturing-sum-line-freq-by-day.py
import pandas as pd
import treasury_gov_pandas
from bokeh.plotting import figure, show
from bokeh.models import NumeralTickFormatter, HoverTool
import bokeh.models
import bokeh.palettes
import bokeh.transform
# ----------------------------------------------------------------------
# df = treasury_gov_pandas.update_records(
View auction-data-table.py
import numpy as np
import pandas as pd
import treasury_gov_pandas
df = treasury_gov_pandas.update_records('https://api.fiscaldata.treasury.gov/services/api/fiscal_service/v1/accounting/od/auctions_query')
# print(df.iloc[0].to_string())
# print(df.iloc[-10].to_string())
View treasury-gov-auction-data-high-yield.py
import pandas as pd
from bokeh.plotting import figure, show
from bokeh.models import NumeralTickFormatter, HoverTool
from bokeh.models import LinearAxis, Range1d
import yfinance as yf
import treasury_gov_pandas
View treasury-gov-auction-data-quarter-line-ratio-spx.py
import pandas as pd
from bokeh.plotting import figure, show
from bokeh.models import NumeralTickFormatter, HoverTool
from bokeh.models import LinearAxis, Range1d
import yfinance as yf
# ---------------------------------------------------------------------
df = treasury_gov_pandas.update_records(
View treasury-gov-auction-data-quarter-line-ratio.py
import pandas as pd
import treasury_gov_pandas
from bokeh.plotting import figure, show
from bokeh.models import NumeralTickFormatter, HoverTool
# ---------------------------------------------------------------------
df = treasury_gov_pandas.update_records(
'auctions_query.pkl',
'https://api.fiscaldata.treasury.gov/services/api/fiscal_service/v1/accounting/od/auctions_query')
# ----------------------------------------------------------------------
View example-revenue-collections-by-month.py
import pandas as pd
import treasury_gov_pandas
from bokeh.plotting import figure, show
from bokeh.models import NumeralTickFormatter, HoverTool
import bokeh.models
import bokeh.palettes
import bokeh.transform
# ----------------------------------------------------------------------
View example-auctions-query-issued-maturing-sum.py
import pandas as pd
import treasury_gov_pandas
from bokeh.plotting import figure, show
from bokeh.models import NumeralTickFormatter, HoverTool
import bokeh.models
import bokeh.palettes
import bokeh.transform
# ----------------------------------------------------------------------
df = treasury_gov_pandas.update_records(
View example-auctions-query-bokeh-simple.py
import pandas as pd
import treasury_gov_pandas
from bokeh.plotting import figure, show
from bokeh.models import NumeralTickFormatter, HoverTool
# ----------------------------------------------------------------------
df = treasury_gov_pandas.update_records(
'auctions_query.pkl',
'https://api.fiscaldata.treasury.gov/services/api/fiscal_service/v1/accounting/od/auctions_query')
# df
View so-example-debt-held-public-amt-multi-func-formatter.py
import requests
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.ticker as mtick
# ----------------------------------------------------------------------
page_size = 10000
url = 'https://api.fiscaldata.treasury.gov/services/api/fiscal_service/v2/accounting/od/debt_to_penny'
View tga-taxes-fy-2023.ps1
$base = 'https://api.fiscaldata.treasury.gov/services/api/fiscal_service/v1/accounting/dts'
$fields = @(
'record_date',
'account_type',
'transaction_type',
'transaction_catg',
# 'transaction_catg_desc',
# 'transaction_today_amt',