Pymrio includes functions to automatically download some of the publicly available global EE MRIO databases. This is currently implemented for WIOD. Further download functionality is planned for EXIOBASE and Eora26.
The functions described here download the raw data files. Thus, they can also be used for post processing by other tools.
WIOD is licensed under the Creative Commons Attribution 4.0 International-license. Thus you can remix, tweak, and build upon WIOD, even commercially, as long as you give credit to WIOD. The WIOD web-page suggest to cite Timmer et al. 2015 when you use the database. You can find more information on the WIOD webpage.
The download function for WIOD currently processes the 2013 release version of WIOD.
To download, start with:
In [1]:
import pymrio
Define a folder for storing the data
In [2]:
wiod_folder = '/tmp/mrios/autodownload/WIOD2013'
And start the download with (this will take a couple of minutes):
In [3]:
wiod_meta = pymrio.download_wiod2013(storage_folder=wiod_folder)
The function returns the meta data for the release (which is stored in metadata.json
in the download folder).
You can inspect the meta data by:
In [4]:
print(wiod_meta)
The WIOD database provide data for several years and satellite accounts. In the default case, all of them are downloaded. You can, however, specify years and satellite account.
You can specify the years as either int or string (2 or 4 digits):
In [5]:
res_years = [97,2004,'2005']
The available satellite accounts for WIOD are listed in the WIOD_CONFIG
.
To get them import this dict by:
In [6]:
from pymrio.tools.iodownloader import WIOD_CONFIG
In [7]:
WIOD_CONFIG
Out[7]:
To restrict this list, you can either copy paste the urls or automatically select the accounts:
In [8]:
sat_accounts = ['EU', 'CO2']
res_satellite = [sat for sat in WIOD_CONFIG['satellite_urls']
if any(acc in sat for acc in sat_accounts)]
In [9]:
res_satellite
Out[9]:
In [10]:
wiod_meta_res = pymrio.download_wiod2013(storage_folder='/tmp/foo_folder/WIOD2013_res',
years=res_years,
satellite_urls=res_satellite)
In [11]:
print(wiod_meta_res)
Subsequent download will only catch files currently not present in the folder, e.g.:
In [12]:
additional_years = [2000, 2001]
wiod_meta_res = pymrio.download_wiod2013(storage_folder='/tmp/foo_folder/WIOD2013_res',
years=res_years + additional_years,
satellite_urls=res_satellite)
only downloads the years given in additional_years
, appending these downloads to the meta data file.
In [13]:
print(wiod_meta_res)
To catch all files, irrespective if present in the storage_folder or not pass overwrite_existing=True
The OECD Inter-Country Input-Output tables (ICIO) are available on the OECD webpage. There is no specific licence given for the these tables, but the webpage state that "Data can be downloaded for free" (per July 2019).
The download function works for both, the 2016 and 2018 release.
To download the data, we first define the folder for storing the data (these will be created if they do not exist yet):
In [14]:
oecd_folder_v2018 = '/tmp/mrios/autodownload/OECD_2018'
oecd_folder_v2016 = '/tmp/mrios/autodownload/OECD_2016'
Than we can start the download with
In [15]:
meta_2018 = pymrio.download_oecd(storage_folder=oecd_folder_v2018)
Be default, the 2018 release of the OECD - ICIO tables are downloaded. To retrieve the 2016 version, pass "version='v2016".
As for WIOD, specific years can be specified by passing a list of years:
In [16]:
meta_2016 = pymrio.download_oecd(storage_folder=oecd_folder_v2016,
version='v2016',
years=[2003, 2008])
Both functions return the meta data describing the download progress and MRIO info. Thus:
In [17]:
print(meta_2018)
Eora26 requires registration prior to download and therefore an automatic download has not been implemented. For further information check the download instruction at the Eora26 example notebook.
EXIOBASE requires registration prior to download and therefore an automatic download has not been implemented. For further information check the download instruction at the EXIOBASE example notebook.