BEA parser walkthrough#
This notebook shows how to parse the official BEA SUPPLY-USE workbook family with mario.parse_bea(...).
Where the files come from#
Relevant official pages:
Guide to the interactive industry input-output accounts tables
Direct ``SUPPLY-USE.zip` bundle <https://apps.bea.gov/industry/release/zip/SUPPLY-USE.zip>`__
MARIO currently supports only the SUPPLY-USE bundle. It does not yet parse:
MAKE-USE-IMPORTS (BEFORE REDEFINITIONS)TOTAL AND DOMESTIC REQUIREMENTS
Supported levels and years#
The parser currently supports three aggregation levels:
summary:1997to2024sector:1997to2024detail:2007,2012,2017
These ranges were verified directly on the current official workbook bundle.
Accepted path inputs#
parse_bea(...) accepts any of these:
the official
SUPPLY-USE.zipone extracted directory containing the BEA workbooks
one workbook path inside that directory
In all cases you still provide:
year=level=
Expected extracted structure and matrix mapping#
Typical extracted SUPPLY-USE bundle:
SUPPLY-USE/
├── Supply_Summary.xlsx
├── Use_Summary.xlsx
├── Supply_Sector.xlsx
├── Use_Sector.xlsx
├── Supply_Detail.xlsx
└── Use_SUT_Detail.xlsx
level= selects the workbook pair and year= selects one year inside that pair.
MARIO reads the bundle as a split-native SUT: S from the domestic-industry block of the supply workbook, U and Yc from the use workbook, Va from the use-workbook footer rows, and Vc from the supply-side columns such as imports, margins, and product taxes. The result should therefore be treated as a mixed-valuation SUT: basic-price supply and purchaser-price use.
[1]:
import mario
[2]:
db = mario.parse_bea(
path="/path/to/SUPPLY-USE",
year=2024,
level="summary",
)
db
INFO Parser: BEA SUT payload ready with shapes S=(71, 73), U=(73, 71), Yc=(73, 19), Va=(11, 71), Vc=(11, 73).
INFO Metadata: initialized.
[2]:
name = BEA Supply-Use 2024 Summary
table = SUT
tech_assumption = industry-based
scenarios = ['baseline']
Activity = 71
Commodity = 73
Factor of production = 11
Satellite account = 1
Consumption category = 19
Region = 1
[3]:
db = mario.parse_bea(
path="/path/to/SUPPLY-USE",
year=2024,
level="sector",
)
INFO Parser: BEA SUT payload ready with shapes S=(15, 17), U=(17, 15), Yc=(17, 5), Va=(11, 15), Vc=(11, 17).
INFO Metadata: initialized.
[4]:
db = mario.parse_bea(
path="/path/to/SUPPLY-USE",
year=2017,
level="detail",
)
INFO Parser: BEA SUT payload ready with shapes S=(402, 402), U=(402, 402), Yc=(402, 19), Va=(10, 402), Vc=(10, 402).
INFO Metadata: initialized.
What the parser builds#
MARIO reads the BEA bundle as a split-native SUT:
Sfrom the BEASupplyworkbookUandYcfrom the BEAUseworkbookVafrom the use-workbook footer rowsVcfrom the supply-workbook commodity-side columns for imports, CIF/FOB adjustments, trade and transport margins, and product taxes
This is therefore a mixed-valuation table:
supply is read at basic prices
use is read at purchaser prices
[5]:
base = db["baseline"]
for name in ["S", "U", "Yc", "Va", "Vc"]:
print(name, base[name].shape)
S (402, 402)
U (402, 402)
Yc (402, 19)
Va (10, 402)
Vc (10, 402)
Caveats#
table="SUT"is the only supported mode right now.The parser does not yet expose the separate
MAKE-USE-IMPORTS (BEFORE REDEFINITIONS)bundle.The parser does not treat
TOTAL AND DOMESTIC REQUIREMENTSas raw database inputs.detailcoverage is much narrower thansummaryandsectorin the current official release.