Skip to main content

gtap_extractor

GTAP is a licensed database for international economics. It is widely used for calibrating Computable General Equilibrium (CGE). GTAP is distributed as unusual .har files, usable with the proprietary GTAPAgg software. This package aims at simplifying the access to GTAP data, by transferring GTAP data into the standard netCDF data format.


Installation

You can install the package by typing pip install gtap-extractor

Usage

The extract_gtap() method takes three optional arguments:

source (path-like) : Path to the raw GTAP .har files. : You will find these files in your GTAP installation. : By default, the current working directory.

name str : Name under which the resulting .nc file is stored

destination (path-like) : Path where the netCDF file will be saved. : By default, the current working directory.

files (list of str) : List of GTAP files to be extracted. : By default, all GTAP files are extracted.

build_mrio (bool) : If True, GTAP data are converted into a simple MRIO table, in basic prices.

The built table is saved under _mrio.nc.

The table consists in three parts:

  • The inter-industry matrix t, built from the VDFB and VMFB variables.
  • The final demand matrix y, built from VMPB, VDPB, VMGB, VDGB, VMIB, VDIB.
  • The value added matrix va, built from EVFB and VTWR.

The construction of t and y relies on the import proportionality assumption: trade shares for each imported good are kept constant across imported sectors.

As imports (VMSB) and exports (VXSB) diverge, trade shares are computed as the arithmetic average of both.

These trade shares are used to ventilate intermediate and final imports.

The value added array includes:

  • Primary endownments (EVFB)
  • The sum of margins and export tariffs (VTWR + XTRV)
  • Net output taxes and subsidies, estimated as the residual value to balance the table.

Dependencies

The package builds on the HARPY, xarray, netcdf4 and MRIO_toolbox libraries.

Note that the HARPY version on pip is outdated. Instead, you can clone the HARPY repository directly using the following command in your terminal:

git clone https://github.com/GEMPACKsoftware/HARPY

Metadata

Release files for gtap-extractor 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gtap-extractor 0.1.1
File Size Uploaded
gtap_extractor-0.1.1.tar.gz 18.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for gtap-extractor 0.1.1
File Interpreter ABI Platform
gtap_extractor-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 38.4 kB

Release files / gtap_extractor-0.1.1.tar.gz

Download URL gtap_extractor-0.1.1.tar.gz
Size 18.7 kB
Tags Source
SHA-256 checksum
How to use checksums
54c2367e1dc8dc2ddeb61080faf96901e86f51dbcd068b112ef7cbdea1994110
BLAKE2b-256 checksum
How to use checksums
e0133110cd275f92849cfcdb86c04a90bde35706ebccbb0a88496d734862bb7a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.19

Release files / gtap_extractor-0.1.1-py3-none-any.whl

Download URL gtap_extractor-0.1.1-py3-none-any.whl
Size 19.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
91d5cbbfe199f0e6e50ad5fe2630589fa6f60f1b22cb0d3da53049b610777ca6
BLAKE2b-256 checksum
How to use checksums
5288e01af5c54bf8233a181d129d56f4a5b0a913ccee7f26194b22cc39ce4d67
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.19

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page