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

pymrio

Multi-Regional Input-Output Analysis in Python.
https://github.com/IndEcol/pymrio

Category: Industrial Ecology
Sub Category: Input Output Model

Keywords

calculations input-output-analysis mrio python

Last synced: about 14 hours ago
JSON representation

Repository metadata

Multi-Regional Input-Output Analysis in Python.

README.rst

          ############
Pymrio
############

Pymrio: Multi-Regional Input-Output Analysis in Python.

.. image:: https://img.shields.io/pypi/v/pymrio.svg
    :target: https://pypi.python.org/pypi/pymrio/
.. image:: https://anaconda.org/conda-forge/pymrio/badges/version.svg   
    :target: https://anaconda.org/conda-forge/pymrio
.. image:: https://github.com/IndEcol/pymrio/workflows/build/badge.svg
    :target: https://github.com/IndEcol/pymrio/actions
.. image:: https://coveralls.io/repos/github/IndEcol/pymrio/badge.svg?branch=master
    :target: https://coveralls.io/github/IndEcol/pymrio
.. image:: https://readthedocs.org/projects/pymrio/badge/?version=latest
    :target: http://pymrio.readthedocs.io/en/latest/?badge=latest
    :alt: Documentation Status
.. image:: https://img.shields.io/badge/License-GPL%20v3-blue.svg
    :target: https://www.gnu.org/licenses/gpl-3.0
.. image:: https://zenodo.org/badge/21688312.svg
    :target: https://zenodo.org/badge/latestdoi/21688312
.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
    :target: https://github.com/psf/black

What is it
==========

Pymrio is an open source tool for analysing global environmentally extended multi-regional input-output tables (EE MRIOs). 
Pymrio aims to provide a high-level abstraction layer for global EE MRIO databases in order to simplify common EE MRIO data tasks. 
Pymrio includes automatic download functions and parsers for available EE MRIO databases like EXIOBASE_, WIOD_ and EORA26_. 
It automatically checks parsed EE MRIOs for missing data necessary for calculating standard EE MRIO accounts (such as footprint, territorial, impacts embodied in trade) and calculates all missing tables. 
Various data report and visualization methods help to explore the dataset by comparing the different accounts across countries. 

Further functions include:

- analysis methods to identify where certain impacts occur
- modifying region/sector classification
- restructuring extensions
- export to various formats
- visualization routines and 
- automated report generation
  

Where to get it
===============

The full source code is available on Github at: https://github.com/IndEcol/pymrio

Pymrio is registered at PyPI and on the Anaconda Cloud. Install it by:

.. code:: bash

    pip install pymrio --upgrade
    
or when using conda install it by

.. code:: bash

    conda install -c conda-forge pymrio

or update to the latest version by

.. code:: bash

    conda update -c conda-forge pymrio

The source-code of Pymrio available at the GitHub repo: https://github.com/IndEcol/pymrio  

The master branch in that repo is supposed to be ready for use and might be 
ahead of the official releases. To install directly from the master branch use:

.. code:: bash

    pip install git+https://github.com/IndEcol/pymrio@master



Quickstart    
==========

A small test mrio is included in the package. 

To use it call

.. code:: python

    import pymrio
    test_mrio = pymrio.load_test()

The test mrio consists of six regions and eight sectors:  

.. code:: python


    print(test_mrio.get_sectors())
    print(test_mrio.get_regions())

The test mrio includes tables flow tables and some satellite accounts. 
To show these:

.. code:: python

    test_mrio.Z
    test_mrio.emissions.F
    
However, some tables necessary for calculating footprints (like test_mrio.A or test_mrio.emissions.S) are missing. pymrio automatically identifies which tables are missing and calculates them: 

.. code:: python

    test_mrio.calc_all()

Now, all accounts are calculated, including footprints and emissions embodied in trade:

.. code:: python

    test_mrio.A
    test_mrio.emissions.D_cba
    test_mrio.emissions.D_exp

To visualize the accounts:


.. code:: python

    import matplotlib as plt
    test_mrio.emissions.plot_account('emission_type1')
    plt.show()

Everything can be saved with

.. code:: python
    
    test_mrio.save_all('some/folder')

See the documentation_ , tutorials_ and  `Stadler 2021`_ for further examples.

Tutorials
=========

The documentation_ includes information about how to use pymrio for automatic downloading_ and parsing_ of the EE MRIOs EXIOBASE_, WIOD_, OECD_ and EORA26_ as well as tutorials_ for the handling, aggregating and analysis of these databases. 

Citation
========

If you use Pymrio in your research, citing the article describing the package 
(`Stadler 2021`_) is very much appreciated. 

.. _`Stadler 2021`: https://openresearchsoftware.metajnl.com/articles/10.5334/jors.251/

For the full bibtex key see CITATION_ file.

.. _CITATION: CITATION

Contributing
=============

Want to contribute? Great!
Please check `CONTRIBUTING.rst`_ if you want to help to improve Pymrio.
  
.. _CONTRIBUTING.rst: https://github.com/IndEcol/pymrio/blob/master/CONTRIBUTING.rst
   
Communication, issues, bugs and enhancements
============================================

Please use the issue tracker for documenting bugs, proposing enhancements and all other communication related to pymrio.

You can follow me on twitter_ to get the latest news about all my open-source and research projects (and occasionally some random retweets).

Research notice
~~~~~~~~~~~~~~~

Please note that this repository is participating in a study into
sustainability of open source projects. Data will be gathered about this
repository for approximately the next 12 months, starting from June
2021.

Data collected will include number of contributors, number of PRs, time
taken to close/merge these PRs, and issues closed.

For more information, please visit `the informational
page `__ or
download the `participant information
sheet `__.


.. _twitter: https://twitter.com/kst_stadler

.. _downloading: http://pymrio.readthedocs.io/en/latest/notebooks/autodownload.html
.. _parsing: http://pymrio.readthedocs.io/en/latest/handling.html
.. _documentation: http://pymrio.readthedocs.io/en/latest/
.. _tutorials: http://pymrio.readthedocs.io/en/latest/handling.html

.. _EXIOBASE: http://www.exiobase.eu/
.. _WIOD: http://www.wiod.org/home
.. _OECD: https://www.oecd.org/sti/ind/inter-country-input-output-tables.htm
.. _EORA26: http://www.worldmrio.com/simplified/


        

Citation (CITATION)

@article{stadler2021_Pymrio,
  title = {Pymrio \textendash{} {{A Python Based Multi}}-{{Regional Input}}-{{Output Analysis Toolbox}}},
  author = {Stadler, Konstantin},
  year = {2021},
  month = may,
  volume = {9},
  pages = {8},
  publisher = {{Ubiquity Press}},
  issn = {2049-9647},
  doi = {10.5334/jors.251},
  abstract = {Pymrio is an open source tool for Environmentally Extended Multi-Regional Input-Output (EE MRIO) analysis developed in Python. It provides a high-level abstraction layer for global EE MRIO databases in order to simplify common EE MRIO data tasks. Among others, Pymrio includes parsers for several openly available EE MRIO databases (EXIOBASE v1 \textendash{} v3, WIOD, Eora26, OECD-ICIO) as well as methods for production and consumption based accounts calculation, aggregation, stressor origin estimation and visualization. The use of a consistent storage format including meta data and modification history for MRIOs allows to exchange data with other analysis tools, aiming for an increased interoperability of Industrial Ecology analysis software.},
  copyright = {Authors who publish with this journal agree to the following terms:    Authors retain copyright and grant the journal right of first publication with the work simultaneously licensed under a  Creative Commons Attribution License  that allows others to share the work with an acknowledgement of the work's authorship and initial publication in this journal.  Authors are able to enter into separate, additional contractual arrangements for the non-exclusive distribution of the journal's published version of the work (e.g., post it to an institutional repository or publish it in a book), with an acknowledgement of its initial publication in this journal.  Authors are permitted and encouraged to post their work online (e.g., in institutional repositories or on their website) prior to and during the submission process, as it can lead to productive exchanges, as well as earlier and greater citation of published work (See  The Effect of Open Access ).  All third-party images reproduced on this journal are shared under Educational Fair Use. For more information on  Educational Fair Use , please see  this useful checklist prepared by Columbia University Libraries .   All copyright  of third-party content posted here for research purposes belongs to its original owners.  Unless otherwise stated all references to characters and comic art presented on this journal are \textcopyright, \textregistered{} or \texttrademark{} of their respective owners. No challenge to any owner's rights is intended or should be inferred.},
  journal = {Journal of Open Research Software},
  keywords = {Consumption Based Accounting,Eora26,EXIOBASE,Footprinting,Multi Regional Input Output Analysis,OECD-ICIO,Python,Sustainability Analysis,WIOD},
  language = {en},
  number = {1}
}



Owner metadata


GitHub Events

Total
Last Year

Committers metadata

Last synced: 5 days ago

Total Commits: 371
Total Committers: 9
Avg Commits per committer: 41.222
Development Distribution Score (DDS): 0.04

Commits in past year: 30
Committers in past year: 4
Avg Commits per committer in past year: 7.5
Development Distribution Score (DDS) in past year: 0.267

Name Email Commits
Konstantin Stadler k****r@n****o 356
Hazim Hussein h****n@n****o 6
Didier D****9 3
jaimeoliver1 j****r@c****i 1
Felix Beckebanze 1****e 1
Joshua Adelman s****s 1
Richard Wood r****d@n****o 1
Yo Yehudi y****h@g****m 1
jaimeoliver1 j****1@g****m 1

Committer domains:


Issue and Pull Request metadata

Last synced: 1 day ago

Total issues: 118
Total pull requests: 42
Average time to close issues: 6 months
Average time to close pull requests: 10 days
Total issue authors: 46
Total pull request authors: 18
Average comments per issue: 1.48
Average comments per pull request: 1.38
Merged pull request: 28
Bot issues: 0
Bot pull requests: 0

Past year issues: 17
Past year pull requests: 6
Past year average time to close issues: about 2 hours
Past year average time to close pull requests: N/A
Past year issue authors: 15
Past year pull request authors: 6
Past year average comments per issue: 0.41
Past year average comments per pull request: 0.5
Past year merged pull request: 0
Past year bot issues: 0
Past year bot pull requests: 0

More stats: https://issues.ecosyste.ms/repositories/lookup?url=https://github.com/IndEcol/pymrio

Top Issue Authors

  • konstantinstadler (51)
  • jbnsn (4)
  • ghost (4)
  • MaximeAgez (3)
  • danielhorengreenford (3)
  • spjuhel (3)
  • cfrancois7 (3)
  • econte94 (2)
  • rich-wood (2)
  • Didou09 (2)
  • majeau-bettez (2)
  • jaimeoliver1 (2)
  • erm-akif (2)
  • Beckebanze (2)
  • dailylifeofwei (2)

Top Pull Request Authors

  • konstantinstadler (13)
  • hazimhussein (7)
  • Didou09 (4)
  • jaimeoliver1 (2)
  • Beckebanze (2)
  • rich-wood (2)
  • trietmnj (1)
  • Kajwan (1)
  • pcorpet (1)
  • spjuhel (1)
  • bixiou (1)
  • francis-barre (1)
  • yochannah (1)
  • ghost (1)
  • MohamedhBadr (1)

Top Issue Labels

  • enhancement (14)
  • bug (10)
  • documentation (3)

Top Pull Request Labels


Package metadata

pypi.org: pymrio

A python module for automating input output calculations and generating reports

  • Homepage: https://github.com/IndEcol/pymrio
  • Documentation: https://pymrio.readthedocs.io/
  • Licenses: GNU Lesser General Public License v3 (LGPLv3)
  • Latest release: 0.5.4 (published about 1 year ago)
  • Last Synced: 2025-04-25T12:07:10.873Z (1 day ago)
  • Versions: 23
  • Dependent Packages: 3
  • Dependent Repositories: 10
  • Downloads: 9,228 Last month
  • Docker Downloads: 62
  • Rankings:
    • Docker downloads count: 2.711%
    • Dependent repos count: 4.67%
    • Forks count: 5.481%
    • Average: 5.646%
    • Stargazers count: 6.422%
    • Downloads: 7.289%
    • Dependent packages count: 7.306%
  • Maintainers (1)

Dependencies

doc/rtd-requirements.txt pypi
  • docutils <0.18
  • ipykernel *
  • nbsphinx *
  • sphinx >=1.6.4
  • sphinx_rtd_theme >=0.2.4
setup.py pypi
  • docutils *
  • matplotlib *
  • numpy *
  • openpyxl *
  • pandas *
  • requests *
  • xlrd *
.github/workflows/publish_pypi.yml actions
  • actions/cache v2 composite
  • actions/checkout v2 composite
  • actions/setup-python v1 composite
  • pypa/gh-action-pypi-publish master composite
.github/workflows/publish_test_pypi.yml actions
  • actions/cache v2 composite
  • actions/checkout v2 composite
  • actions/setup-python v1 composite
  • pypa/gh-action-pypi-publish release_candidates composite
.github/workflows/tests_and_coverage.yml actions
  • actions/cache v2 composite
  • actions/checkout v2 composite
  • actions/setup-python v2 composite
  • conda-incubator/setup-miniconda v2 composite
environment.yml conda
  • black >=22.8
  • country_converter >=0.8.0
  • coveralls
  • docutils >=0.14
  • ipykernel
  • ipython
  • isort >=5.6.0
  • jupyterlab 3.*
  • jupytext
  • matplotlib
  • nbsphinx
  • nbval
  • openpyxl >=3.0.6
  • pandas >=1.5
  • pdbpp
  • pynvim
  • pytest >=5.4.3
  • pytest-black
  • python 3.9.*
  • requests >=2.18
  • sphinx >=1.6.4
  • sphinx_rtd_theme >=0.2.4
  • xlrd >1.1.0

Score: 16.81199529834408