spending_explorer
Explore all federal spending for a fiscal year, broken down by budget function, agency, federal account, program activity, object class, recipient, or award.
Examples
from openbb import obb
# Break all federal spending down by object class.
obb.ustreasury.spending_explorer(provider='us_treasury')
# Drill into the agencies acquiring assets.
obb.ustreasury.spending_explorer(explorer_type='agency', scope='object_class:30', provider='us_treasury')
# Drill into one agency's federal accounts for an object class.
obb.ustreasury.spending_explorer(explorer_type='federal_account', scope='agency:1173', object_class='30', provider='us_treasury')
Parameters
- standard
- us_treasury
explorer_type: str | None
Default: object_class
Dimension to break the spending down by. Every dimension works on its own except 'program_activity', 'recipient', 'award', 'award_category', which are too large to enumerate government-wide and need a scoping filter. A scope on the dimension being broken down is ignored, since breaking down by a dimension means showing every one of its entries.
fiscal_year: int | None
Federal fiscal year. When None, the most recent year the source has published is used. Data begins in FY2017 Q2.
period: str | None
Default: latest
Federal fiscal period to report through. Amounts are cumulative from the start of the fiscal year, so 'Through March' covers October through March. 'latest' resolves to the most recent period the source has published, because a period that has not closed yet is rejected.
budget_function: str | None
Scope the breakdown to one budget function, by its code.
budget_subfunction: str | None
Scope the breakdown to one budget sub-function, by its code.
agency: str | None
Scope the breakdown to one agency, by the id returned for an 'agency' breakdown.
federal_account: str | None
Scope the breakdown to one federal account, by the id returned for a 'federal_account' breakdown.
program_activity: str | None
Scope the breakdown to one program activity, by its id.
object_class: str | None
Scope the breakdown to one object class, by its code, e.g. '30' for Acquisition of assets.
recipient: str | None
Scope the breakdown to one recipient, by its id.
Returns
results: UsSpendingExplorer
Serializable results.
provider: str | None
Provider name.
warnings: Optional[list[Warning_]]
List of warnings.
chart: Optional[Chart]
Chart object.
extra: dict[str, Any]
Extra info.
Data
- standard
- us_treasury
name: str | None
Name of the breakdown entry.
amount: float | None
Obligated amount, in dollars, cumulative through the requested period.
percent_of_total: float | None
The entry's share of the breakdown total, as a percentage.
code: str | None
Code of the breakdown entry, where the dimension has one.
account_number: str | None
Federal account symbol, for a 'federal_account' breakdown.
explorer_id: str | None
Identifier of the entry within its dimension, as the matching scope filter accepts it.
as_of_date: str | None
Date the reported data is current as of.