mario.parse_from_excel#
- mario.parse_from_excel(path: str, table: str, mode: str, data_sheet: str = 0, unit_sheet: str = 'units', matrix_layouts: dict[str, object] | None = None, tech_assumption: str | None = None, calc_all: bool = False, year: int = None, name: str = None, source: str = None, model: str = 'Database', **kwargs)#
Parse a database from a single Excel workbook.
Note
This function works with a a single excel that contains data & units
The table kind remains
IOTorSUT;matrix_layoutscan be used to override the semantic layout of selected matricesworkbooks generated by
mario.write_parse_template(...)are detected automatically; they do not needmatrix_layouts
- Parameters:
path (str) – defined the excel file that contains data & units.
table (str) – acceptable options are ‘IOT’ & ‘SUT’
mode (str) –
defined the base matrices to parse. The options are:
flows: needs [Z, Y, EY, V, E,] in a singel sheet and unit in another sheet
coefficients: needs [z, Y, EY, v, e, units.txt] in a singel sheet and unit in another sheet
data_sheet (str, int) – defines the sheet index/name which the data is located(by defualt the first sheet is considered)
units_sheet (str,int) – defines the sheet index/name in which the units are located (by default in a sheet named units )
matrix_layouts (dict, Optional) –
optional per-matrix semantic layout declarations. Values can be:
a single set name, for example
{"E": "Region"}a tuple/list of set names, for example
{"E": ("Region", "Sector")}
Only canonical MARIO set names are accepted. Matrices omitted from the dictionary are treated as standard layouts.
calc_all (boolean) – if True, by default will calculate z,v,e,Z,V,E after parsing
year (int, Optional) – optional to the Database (just for recoding the metadata)
source (str, Optional) – optional to the Database (just for recoding the metadata)
name (str, Optional) – optional but suggested. is useful for visualization and metadata.
- Return type:
mario.Database