Skip to main content

Extract GTAP data from .har files and save it as .nc file.

Project description

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.

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.

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.

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

Dependences

The package builds on the HARPY, xarray and netcdf4 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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gtap_extractor-0.1.0.tar.gz (18.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gtap_extractor-0.1.0-py3-none-any.whl (19.7 kB view details)

Uploaded Python 3

File details

Details for the file gtap_extractor-0.1.0.tar.gz.

File metadata

  • Download URL: gtap_extractor-0.1.0.tar.gz
  • Upload date:
  • Size: 18.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.19

File hashes

Hashes for gtap_extractor-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e3ed33b70466970a343d3dc61ba5bafdfb8bb4ffd15c0e91b24a194581382a18
MD5 24a66d9fafb5c99d405e6eec11e088b3
BLAKE2b-256 57284de39ce141959d85fd2dafef3b099d84c9284f5db473479e7ba49560fcf8

See more details on using hashes here.

File details

Details for the file gtap_extractor-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: gtap_extractor-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 19.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.19

File hashes

Hashes for gtap_extractor-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8901f998f4cce3a7c519b6936abed024d0ebb3ef349c9d825a76261d8c7b4b06
MD5 f162edfb493f361c11967e00fdc95732
BLAKE2b-256 57690cb839733aa1da4f392d66089741dc5074f606ccd4054cad1eb5a495ac65

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page