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 .xlsx workbook or to a directory containing one or more of those workbooks.

parse_adb supports 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 economies releases). parse_adb auto-detects the header layout used by each workbook. When path points to a directory that contains more than one candidate MRIO workbook, use year= and/or economies= 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 .xlsx workbook or to a directory containing one or more ADB workbooks.

  • table (str, optional) – ADB parsing currently supports only IOT tables.

  • year (int, optional) – reference year used to select one MRIO workbook when path points 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, 72 or 74.

  • add_extensions (str, optional) – optional path to an ADB air-emissions workbook. When provided, MARIO imports the environmental extension matrices E and EY from that file. The same mechanism works for both MRIO and SRIO economic tables. The matching air-emissions workbooks are distributed on the ADB page at https://kidb.adb.org/globalization/adb_environmentally_extended_multiregional_inputoutput_tables.

  • model (str, optional) – public MARIO model class to instantiate. Database is 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 optionally economies=;

  • 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_extensions is 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.