mario.parse_adb#
- mario.parse_adb(path: str, table: str = 'IOT', year: int | None = None, economies: int | None = None, add_extensions: str | None = None, model: str = 'Database', name: str | None = None, calc_all: bool = False, **kwargs) object#
Parse one locally downloaded ADB MRIO or SRIO Excel workbook.
This parser targets the Asian Development Bank Excel workbooks distributed on the official ADB MRIO page at
https://kidb.adb.org/globalization/current. MARIO does not implement any automatic download here: callers should point the parser to one local.xlsxworkbook or to a directory containing one or more of those workbooks.parse_adbsupports both:ADB MRIO workbooks, typically one workbook per release year;
ADB SRIO workbooks, where one workbook contains multiple yearly sheets.
The MRIO release family also mixes closely related workbook variants (for example the 2017 LAC release and the 2024
62/72/74 economiesreleases).parse_adbauto-detects the header layout used by each workbook. Whenpathpoints to a directory that contains more than one candidate MRIO workbook, useyear=and/oreconomies=to disambiguate or point directly to one file. For SRIO workbooks,year=is required because one workbook contains multiple annual sheets.- Parameters:
path (str) – path to one local ADB
.xlsxworkbook or to a directory containing one or more ADB workbooks.table (str, optional) – ADB parsing currently supports only
IOTtables.year (int, optional) – reference year used to select one MRIO workbook when
pathpoints to a directory containing multiple yearly releases. For SRIO workbooks, this selects the yearly sheet and is mandatory.economies (int, optional) – MRIO workbook variant selector used when a directory contains more than one release for the same year. This matches the folder/file marker values commonly used by the downloaded workbooks, such as
62,71,72or74.add_extensions (str, optional) – optional path to an ADB air-emissions workbook. When provided, MARIO imports the environmental extension matrices
EandEYfrom that file. The same mechanism works for both MRIO and SRIO economic tables. The matching air-emissions workbooks are distributed on the ADB page athttps://kidb.adb.org/globalization/adb_environmentally_extended_multiregional_inputoutput_tables.model (str, optional) – public MARIO model class to instantiate.
Databaseis the default and the only supported value.name (str, optional) – optional dataset name stored in metadata.
calc_all (bool, optional) – whether to materialize derived blocks immediately after parsing.
Notes
In normal usage there are four common parse patterns:
direct path to one MRIO workbook;
path to one directory containing multiple MRIO workbooks, resolved with
year=and optionallyeconomies=;direct path to one SRIO workbook, where
year=selects the annual sheet;either of the previous two cases plus
add_extensions=...to attach the matching air-emissions table.
When
add_extensionsis used, MARIO records parser warnings in the database metadata history if:the emissions workbook year does not match the economic table year;
the emissions workbook does not cover all regions present in the economic table.
Those warnings do not stop the parse. They can be inspected after parsing through
db.meta_history.