Open Sustainable Technology

A curated list of open technology projects to sustain a stable climate, energy supply, biodiversity and natural resources.

Browse accepted projects | Review proposed projects | Propose new project | Open Issues

MARIO

Perform impact analysis using regional input-output tables and models.
https://github.com/it-is-me-mario/mario

Last synced: about 9 hours ago
JSON representation

Repository metadata

Multifunctional Analysis of Regions through Input-Output

README

        

.. image:: https://img.shields.io/gitter/room/SESAM-Polimi/MARIO
:target: https://gitter.im/SESAM-Polimi/MARIO

.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
:target: https://github.com/psf/black

.. image:: https://readthedocs.org/projects/mario-suite/badge/?version=latest
:target: https://mario-suite.readthedocs.io/en/latest/index.html
:alt: Documentation Status

.. image:: https://badge.fury.io/py/mariopy.svg
:target: https://badge.fury.io/py/mariopy

.. image:: https://raw.githubusercontent.com/SESAM-Polimi/MARIO/767d2c0e9e42ae0b6acf7c3a1cc379d7bcd367fa/doc/source/_static/images/polimi.svg
:width: 200
:align: right

.. image:: https://zenodo.org/badge/421900437.svg
:target: https://zenodo.org/badge/latestdoi/421900437

*******
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 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, version 3.7 or higher
#. A number of Python adds-on packages
#. For some functionalities a solver may needed (optional)
#. MARIO software itself

Recommended installation method
-------------------------------

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

.. code-block:: python

conda create -n mario python=3.8

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*

.. code-block:: python

conda activate mario

Now you can use pip to install mario on your environment as follow:

.. code-block:: python

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

.. code-block:: python

import mario
test_iot = mario.load_test('IOT')

and to use the SUT test, call

.. code-block:: python

test_sut = mario.load_test('SUT')

To see the configurations of the data, you can print them:

.. code-block:: python

print(test_iot)
print(test_sut)

To see specific sets of the tables like regions or value added,
get_index function can be used:

.. code-block:: python

print(test_iot.get_index('Region'))
print(test_sut.get_index('Factor of production'))

To visualize some data, various plot functions can be used:

.. code-block:: python

test_iot.plot_matrix(....)

Specific modifications on the database can be done, such as
SUT to IOT transformation:

.. code-block:: python

reformed_iot = test.to_iot(method='B')

The changes can be tracked by metadata. The history can be checked by calling:

.. code-block:: python

reformed_iot.meta_history

The new database can be saved into excel,txt or csv file:

.. code-block:: python

reformed_iot.to_excel(path='a folder//database.xlsx')

.. _RST pckgs:

Python module requirements
--------------------------
Some of the key packages the mario relies on are:

* `Pandas `_
* `Numpy `_
* `Plotly `_
* `Tabulate `_
* `Pymrio `_
* `Cvxpy `_ (Optional in this version)

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:

.. code-block:: python

pytest --cov=mario tests/

.. note::
* This project is under active development.
* More examples will be uploaded through time to the gellery.
* More parsers will be added to the next version.
* The next version will cover some optimization models within the IO framework
* For more tutorials on mario, check out our `Input-Output analysis and modelling with MARIO Course `_

License
-------

.. image:: https://www.gnu.org/graphics/gplv3-or-later.png
:target: https://www.gnu.org/licenses/gpl-3.0.en.html

This work is licensed under a `GNU GENERAL PUBLIC LICENSE `_


Owner metadata


GitHub Events

Total
Last Year

Committers metadata

Last synced: 1 day ago

Total Commits: 201
Total Committers: 7
Avg Commits per committer: 28.714
Development Distribution Score (DDS): 0.179

Commits in past year: 12
Committers in past year: 3
Avg Commits per committer in past year: 4.0
Development Distribution Score (DDS) in past year: 0.5

Name Email Commits
Mohammad Amin Tahavori 5****t 165
Lorenzo Rinaldi 4****i 11
Nicolò Golinucci n****i@g****m 9
LorenzoRinaldi l****1@g****m 8
Lorenzo Rinaldi l****3@g****m 5
Nicolò Golinucci 5****d 2
Amedeo Felice Alberio a****a@f****m 1

Committer domains:


Issue and Pull Request metadata

Last synced: 1 day ago

Total issues: 50
Total pull requests: 38
Average time to close issues: 3 months
Average time to close pull requests: 11 days
Total issue authors: 5
Total pull request authors: 6
Average comments per issue: 0.58
Average comments per pull request: 0.18
Merged pull request: 30
Bot issues: 0
Bot pull requests: 0

Past year issues: 15
Past year pull requests: 12
Past year average time to close issues: 3 months
Past year average time to close pull requests: 2 days
Past year issue authors: 3
Past year pull request authors: 4
Past year average comments per issue: 0.2
Past year average comments per pull request: 0.17
Past year merged pull request: 8
Past year bot issues: 0
Past year bot pull requests: 0

More stats: https://issues.ecosyste.ms/repositories/lookup?url=https://github.com/it-is-me-mario/mario

Top Issue Authors

  • mohammadamint (21)
  • nigolred (14)
  • LorenzoRinaldi (13)
  • adrienjacob (1)
  • maximikos (1)

Top Pull Request Authors

  • mohammadamint (17)
  • LorenzoRinaldi (13)
  • nigolred (5)
  • gitter-badger (1)
  • AAmedeo (1)
  • geo-mathijs (1)

Top Issue Labels

  • enhancement (16)
  • bug (7)
  • documentation (5)
  • good first issue (1)
  • help wanted (1)
  • NXG (1)
  • FUL (1)
  • dependencies (1)

Top Pull Request Labels

  • enhancement (1)
  • NXG (1)
  • FUL (1)

Package metadata

pypi.org: mariopy

A python package for automating input-output (IO) calculations, models,visualization and scenario analysis

  • Homepage: https://github.com/it-is-me-mario/MARIO
  • Documentation: https://mariopy.readthedocs.io/
  • Licenses: GNU General Public License v3.0
  • Latest release: 0.2.2 (published 8 months ago)
  • Last Synced: 2024-05-10T10:00:35.848Z (1 day ago)
  • Versions: 4
  • Dependent Packages: 1
  • Dependent Repositories: 1
  • Downloads: 115 Last month
  • Rankings:
    • Dependent packages count: 4.744%
    • Stargazers count: 11.855%
    • Forks count: 11.93%
    • Average: 14.644%
    • Dependent repos count: 21.642%
    • Downloads: 23.052%
  • Maintainers (4)

Dependencies

Pipfile pypi
  • twine * develop
Pipfile.lock pypi
  • bleach ==4.1.0 develop
  • certifi ==2021.10.8 develop
  • charset-normalizer ==2.0.7 develop
  • colorama ==0.4.4 develop
  • docutils ==0.18 develop
  • idna ==3.3 develop
  • importlib-metadata ==4.8.1 develop
  • keyring ==23.2.1 develop
  • packaging ==21.2 develop
  • pkginfo ==1.7.1 develop
  • pygments ==2.10.0 develop
  • pyparsing ==2.4.7 develop
  • pywin32-ctypes ==0.2.0 develop
  • readme-renderer ==30.0 develop
  • requests ==2.26.0 develop
  • requests-toolbelt ==0.9.1 develop
  • rfc3986 ==1.5.0 develop
  • six ==1.16.0 develop
  • tqdm ==4.62.3 develop
  • twine ==3.4.2 develop
  • urllib3 ==1.26.7 develop
  • webencodings ==0.5.1 develop
  • zipp ==3.6.0 develop
doc/docs-requirements.txt pypi
  • IPython >=7.22.0
  • ipykernel *
  • nbsphinx *
  • numpy >=1.21.2
  • openpyxl >=3.0.6
  • pandas >=1.3.3
  • plotly >=4.12.0
  • pymrio >=0.4.6
  • sphinx >=1.6.4
  • sphinx-autobuild *
  • sphinx_rtd_theme >=0.2.4
  • tabulate >=0.8.9
  • xlsxwriter <=1.3.7
requirements.txt pypi
  • IPython >=7.22.0
  • numpy >=1.21.2
  • openpyxl >=3.0.6
  • pandas >=1.3.3
  • plotly >=4.12.0
  • pymrio *
  • tabulate >=0.8.9
  • xlsxwriter <=1.3.7
setup.py pypi
  • IPython *
  • numpy *
  • openpyxl *
  • pandas *
  • plotly *
  • pymrio *
  • tabulate *
  • xlsxwriter *

Score: 10.819378204388943