write_parse_template#

mario.write_parse_template(path: str, *, table: str, sets: dict[str, object] | None = None, units: dict[str, object] | None = None, definition: str | Path | DataFrame | None = None, format: str = 'flat')#

Write one MARIO-ready Excel template from user-defined sets and units.

Parameters:
  • path (str) – Output workbook path.

  • table (str) – Either "IOT" or "SUT".

  • sets (dict, optional) – Dictionary containing the items for each required set. Set names accept the same aliases MARIO already recognizes, for example regions, sectors, activities, commodities, factors of production, and final demand.

  • units (dict, optional) – Dictionary containing the units for unit-bearing sets. Each payload can be one shared string for the whole set or one mapping/Series/DataFrame indexed by item.

  • definition (str or pandas.DataFrame, optional) – Definition workbook generated by write_template_definition(). When provided, sets and units are read from that workbook and should not be passed separately.

  • format (str, optional) – "flat" writes the explicit workbook layout meant to be filled and parsed back with mario.parse_from_excel(). "matrix" writes the historical matrix workbook layout. "flat" is the default.