pymrio.MRIOMetaData

class pymrio.MRIOMetaData(location=None, description=None, name=None, system=None, version=None, logger_function=<function info>)
__init__(location=None, description=None, name=None, system=None, version=None, logger_function=<function info>)

Organzises the MRIO meta data

The meta data is stored in a json file.

Note

The parameters ‘description’, ‘name’, ‘system’, and ‘version’ should be set during the establishment of the meta data file. If the meta data file already exists and they are given again, the corresponding entry will be overwritten if replace_existing_meta_content is set to True (with a note in the ‘History’ field.)

Parameters:
  • location (str, valid path, optional) – Path or file for loading a previously saved metadata file and/or saving additional metadata (the method ‘save’ will use this location by default). This can be the full file path or just the storage folder. In the latter case, the filename defined in DEFAULT_FILE_NAMES[‘metadata’] (currently ‘metadata.json’) is assumed.
  • description (str, optional) – Description of the metadata file purpose and mrio, default set to ‘Metadata file for pymrio’. Will be set the first time the metadata file gets established; subsequent changes are recorded in ‘history’.
  • name (str, optional) – Name of the mrio (e.g. wiod, exiobase) Will be set the first time the metadata file gets established; subsequent changes are recorded in ‘history’.
  • system (str, optional) – For example ‘industry by industry’, ‘ixi’, … Will be set the first time the metadata file gets established; subsequent changes are recorded in ‘history’.
  • version (str, int, float, optional) – Version number Will be set the first time the metadata file gets established; subsequent changes are recorded in ‘history’.
  • logger_function (func, optional) – Function accepting strings. The info string written to the metadata is also passed to this function. By default, the funtion is set to logging.info. Set to None for no output.

Methods

__init__([location, description, name, …]) Organzises the MRIO meta data
change_meta(para, new_value[, log]) Changes the meta data
note(entry) Add the passed string as note to the history
save([location]) Saves the current status of the metadata