A python package for automating input-output (IO) calculations, models,visualization and scenario analysis
Project description
MARIO
Multifunctional Analysis of Regions through Input-Output. (Documents)
What is it
MARIO is a python package for handling input-output tables and models inspired by Pymrio . MARIO aims to provide a simple & intuitive API for common IO tasks without needing in-depth programming knowledge. MARIO supporst automatic parsing of different structured tables such EXIOBASE, EORA, EUROSTAT, and FIGARO in different formats namely:
Single region
Multi region
Hybrid tables
Monetary tables
Input-Output tables
Supply-Use tables
When databases are not structured, MARIO supports parsing data from xlsx, csv, txt files or pandas.DataFrames.
More than parsing data, MARIO includes some basic functionalities:
Aggregation of databases
SUT to IOT transformation
- Modifying database in terms of adding:
New sectors, activities or commodities to the database
Adding new extensions to the satellite account
Scneario and shock analysis
Backward and forward linkages analysis
Extracting single region database from multi region databases
Balance test
Productivity test
Exporting the databases into different formats for scenarios analyzed
Interactive visualization routines
Requirements
MARIO has been tested on macOS and Windows.
To run MARIO, a couple of things are needed:
Being in love with Input-Output :-)
The Python programming language
A number of Python adds-on packages
MARIO software itself
Installation
The easiest way to make MARIO software working is to use the free conda package manager which can install the current and future MARIO depencies in an easy and user friendly way.
To get conda, download and install “Anaconda Distribution” . Between differnet options for running python codes, we strongly suggest, Spyder, which is a free and open source scientific environment written in Python, for Python, and designed by and for scientists, engineers and data analysts.
You can install mario using pip or from source code. It is suggested to create a new environment by running the following command in the anaconda prompt
conda create -n mario python=3.10
If you create a new environment for mario, to use it, you need to activate the mario environment each time by writing the following line in Anaconda Prompt
conda activate mario
Now you can use pip to install mario on your environment as follow:
pip install mariopy
You can also install from the source code!
Quickstart
A simple test for Input-Output Table (IOT) and Supply-Use Table (SUT) is included in mario.
To use the IOT test, call
import mario
test_iot = mario.load_test('IOT')
and to use the SUT test, call
test_sut = mario.load_test('SUT')
To see the configurations of the data, you can print them:
print(test_iot)
print(test_sut)
To see specific sets of the tables like regions or value added, get_index function can be used:
print(test_iot.get_index('Region'))
print(test_sut.get_index('Factor of production'))
To visualize some data, various plot functions can be used:
test_iot.plot_matrix(....)
Specific modifications on the database can be done, such as SUT to IOT transformation:
reformed_iot = test.to_iot(method='B')
The changes can be tracked by metadata. The history can be checked by calling:
reformed_iot.meta_history
The new database can be saved into excel,txt or csv file:
reformed_iot.to_excel(path='a folder//database.xlsx')
Citation
In case you use mario, you should use our peer reviewed publication (Tahavori, Golinucci, Rinaldi, et al.) for citiation!
Read more
Testing MARIO
The current version of Mario has achieved a test coverage of 49%. This coverage includes a comprehensive 100% assessment of the fundamental mathematical engine. Additional tests are currently in active development to enhance the package’s reliability. Mario utilizes pytest as its primary tool for conducting unit tests. For a more detailed analysis of the test coverage pertaining to mario’s unit tests, you can execute the following command:
pytest --cov=mario tests/
Publications
Assessing environmental and market implications of steel decarbonisation strategies: a hybrid input-output model for the European Union (Rinaldi et al, Environmental Research Letters, 2024 )
Assessing critical materials demand in global energy transition scenarios based on the Dynamic Extraction and Recycling Input-Output framework (DYNERIO) (Rinaldi et al, Resources Conservation adn Recycling, 2023 )
Three different directions in which the European Union could replace Russian natural gas (Nikas et al, Energy, 2024 )
Investigating the economic and environmental impacts of a technological shift towards hydrogen-based solutions for steel manufacture in high-renewable electricity mix scenarios for Italy (Marco Conte et al, IOP Conf. Ser.: Earth Environ. Sci., 2022)
Support Materials
License
This work is licensed under a GNU GENERAL PUBLIC LICENSE
Supporting Institutions
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file mariopy-0.3.4.tar.gz
.
File metadata
- Download URL: mariopy-0.3.4.tar.gz
- Upload date:
- Size: 35.5 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ef664b7a46facaed77bd0bd2fcc6057cc7506c16ca207d2ac530d8b22fa5d3c0 |
|
MD5 | 770e09ea94c5e992c6e6e45310036436 |
|
BLAKE2b-256 | 6d48e907702fcdb1a924de29f2bc0cfcba30460f78c29880eb7647117cfd577e |
File details
Details for the file mariopy-0.3.4-py3-none-any.whl
.
File metadata
- Download URL: mariopy-0.3.4-py3-none-any.whl
- Upload date:
- Size: 154.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.8
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b04d4e0f5329d56932251dc4c2b966eefa192b6b28278cf5f1cb6d8674869ea9 |
|
MD5 | 9a6e07aa045c7da4ffaacbe060673665 |
|
BLAKE2b-256 | 11aceaee6754cfab0125ae74ddfedeac25cd81291e3fcdb89172e71230af3a7d |