Skip to content

Instantly share code, notes, and snippets.

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
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(
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')
# ----------------------------------------------------------------------
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
# ----------------------------------------------------------------------
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(
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
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'
$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',
$base = 'https://api.fiscaldata.treasury.gov/services/api/fiscal_service/v1/accounting/dts'
$rest_url = '/deposits_withdrawals_operating_cash?filter=record_date:gte:{0},transaction_catg:eq:{1}&fields=record_date,transaction_today_amt&page[number]=1&page[size]=900'
# ----------------------------------------------------------------------
$date = '2020-10-09'
$account_type = 'Treasury General Account Total Deposits'
Param([string[]] $years, [switch]$display_chart_url, [switch]$save_iframe)
if ($years -eq $null)
{
$years = @(Get-Date -Format 'yyyy')
}
# ----------------------------------------------------------------------