Package: pymrio
Pymrio: Multi-Regional Input-Output Analysis in Python.What is itPymrio 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 likeEXIOBASE,WIODandEORA26.
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 occurmodifying region/sector classificationrestructuring extensionsexport to various formatsvisualization routines andautomated report generationWhere to get itThe full source code is available on Github at:https://github.com/IndEcol/pymrioPymrio is registered at PyPI and on the Anaconda Cloud. Install it by:pipinstallpymrio--upgradeor when using conda install it bycondainstall-cconda-forgepymrioor update to the latest version bycondaupdate-cconda-forgepymrioThe source-code of Pymrio available at the GitHub repo:https://github.com/IndEcol/pymrioThe 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:pipinstallgit+https://github.com/IndEcol/pymrio@masterQuickstartA small test mrio is included in the package.To use it callimportpymriotest_mrio=pymrio.load_test()The test mrio consists of six regions and eight sectors:print(test_mrio.get_sectors())print(test_mrio.get_regions())The test mrio includes tables flow tables and some satellite accounts.
To show these:test_mrio.Ztest_mrio.emissions.FHowever, 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:test_mrio.calc_all()Now, all accounts are calculated, including footprints and emissions embodied in trade:test_mrio.Atest_mrio.emissions.D_cbatest_mrio.emissions.D_expTo visualize the accounts:importmatplotlibasplttest_mrio.emissions.plot_account('emission_type1')plt.show()Everything can be saved withtest_mrio.save_all('some/folder')See thedocumentation,tutorialsandStadler 2021for further examples.TutorialsThedocumentationincludes information about how to use pymrio for automaticdownloadingandparsingof the EE MRIOsEXIOBASE,WIOD,OECDandEORA26as well astutorialsfor the handling, aggregating and analysis of these databases.CitationIf you use Pymrio in your research, citing the article describing the package
(Stadler 2021) is very much appreciated.For the full bibtex key seeCITATIONfile.ContributingWant to contribute? Great!
Please checkCONTRIBUTING.rstif you want to help to improve Pymrio.Communication, issues, bugs and enhancementsPlease use the issue tracker for documenting bugs, proposing enhancements and all other communication related to pymrio.You can follow me ontwitterto get the latest news about all my open-source and research projects (and occasionally some random retweets).Research noticePlease 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 visitthe informational
pageor
download theparticipant information
sheet.