gtap-extractor


Namegtap-extractor JSON
Version 0.1.1 PyPI version JSON
download
home_pagehttps://gitlab.pik-potsdam.de/mrio_toolbox/gtap_extractor
SummaryExtract GTAP data from .har files and save it as .nc file.
upload_time2024-11-11 16:56:30
maintainerNone
docs_urlNone
authorTimothe Beaufils
requires_pythonNone
licenseNone
keywords gtap mrio input-output economics industrial ecology netcdf international trade
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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 <name>_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](https://github.com/GEMPACKsoftware/HARPY), [xarray](https://xarray.pydata.org/en/v2024.07.0/index.html), [netcdf4](http://unidata.github.io/netcdf4-python/) and [MRIO_toolbox](https://gitlab.pik-potsdam.de/beaufils/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

            

Raw data

            {
    "_id": null,
    "home_page": "https://gitlab.pik-potsdam.de/mrio_toolbox/gtap_extractor",
    "name": "gtap-extractor",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "GTAP, MRIO, Input-Output, Economics, Industrial Ecology, netcdf, International Trade",
    "author": "Timothe Beaufils",
    "author_email": "timothe.beaufils@pik-potsdam.de",
    "download_url": "https://files.pythonhosted.org/packages/e0/13/3110cd275f92849cfcdb86c04a90bde35706ebccbb0a88496d734862bb7a/gtap_extractor-0.1.1.tar.gz",
    "platform": null,
    "description": "# gtap_extractor\r\n\r\nGTAP is a licensed database for international economics.\r\nIt is widely used for calibrating Computable General Equilibrium (CGE).\r\nGTAP is distributed as unusual .har files, usable with the proprietary GTAPAgg software.\r\nThis package aims at simplifying the access to GTAP data, by transferring GTAP data into the standard netCDF data format.\r\n\r\n---\r\n\r\n## Installation\r\n\r\nYou can install the package by typing `pip install gtap-extractor`\r\n\r\n## Usage\r\n\r\nThe *extract_gtap()* method takes three optional arguments:\r\n\r\n**source** *(path-like)*\r\n   : Path to the raw GTAP .har files.\r\n   : You will find these files in your GTAP installation.\r\n   : By default, the current working directory.\r\n\r\n**name** *str*\r\n    : Name under which the resulting .nc file is stored\r\n\r\n\r\n**destination** *(path-like)*\r\n   : Path where the netCDF file will be saved.\r\n   : By default, the current working directory.\r\n\r\n**files** *(list of str)*\r\n   : List of GTAP files to be extracted.\r\n   : By default, all GTAP files are extracted.\r\n\r\n**build_mrio** *(bool)*\r\n    : If True, GTAP data are converted into a simple MRIO table, in basic prices.\r\n\r\n\r\n>The built table is saved under <name>_mrio.nc.\r\n>\r\n>The table consists in three parts:\r\n> - The inter-industry matrix t, built from the VDFB and VMFB variables.\r\n> - The final demand matrix y, built from VMPB, VDPB, VMGB, VDGB, VMIB, VDIB.\r\n> - The value added matrix va, built from EVFB and VTWR.\r\n>\r\n>The construction of t and y relies on the import proportionality assumption: trade shares for each imported good are kept constant across imported sectors.\r\n>\r\n>As imports (VMSB) and exports (VXSB) diverge, trade shares are computed as the arithmetic average of both.\r\n>\r\n>These trade shares are used to ventilate intermediate and final imports.\r\n>\r\n> The value added array includes:\r\n> - Primary endownments (EVFB)\r\n> - The sum of margins and export tariffs (VTWR + XTRV)\r\n> - Net output taxes and subsidies, estimated as the residual value to balance the table.\r\n    \r\n\r\n\r\n---\r\n\r\n## Dependencies \r\n\r\nThe package builds on the [HARPY](https://github.com/GEMPACKsoftware/HARPY), [xarray](https://xarray.pydata.org/en/v2024.07.0/index.html), [netcdf4](http://unidata.github.io/netcdf4-python/) and [MRIO_toolbox](https://gitlab.pik-potsdam.de/beaufils/mrio-toolbox) libraries.\r\n\r\nNote that the HARPY version on pip is outdated.\r\nInstead, you can clone the HARPY repository directly using the following command in your terminal:\r\n\r\ngit clone https://github.com/GEMPACKsoftware/HARPY\r\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Extract GTAP data from .har files and save it as .nc file.",
    "version": "0.1.1",
    "project_urls": {
        "Homepage": "https://gitlab.pik-potsdam.de/mrio_toolbox/gtap_extractor"
    },
    "split_keywords": [
        "gtap",
        " mrio",
        " input-output",
        " economics",
        " industrial ecology",
        " netcdf",
        " international trade"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5288e01af5c54bf8233a181d129d56f4a5b0a913ccee7f26194b22cc39ce4d67",
                "md5": "ec33520c9437278c67875e403ad4ed1c",
                "sha256": "91d5cbbfe199f0e6e50ad5fe2630589fa6f60f1b22cb0d3da53049b610777ca6"
            },
            "downloads": -1,
            "filename": "gtap_extractor-0.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ec33520c9437278c67875e403ad4ed1c",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 19724,
            "upload_time": "2024-11-11T16:56:29",
            "upload_time_iso_8601": "2024-11-11T16:56:29.257675Z",
            "url": "https://files.pythonhosted.org/packages/52/88/e01af5c54bf8233a181d129d56f4a5b0a913ccee7f26194b22cc39ce4d67/gtap_extractor-0.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e0133110cd275f92849cfcdb86c04a90bde35706ebccbb0a88496d734862bb7a",
                "md5": "4b70109958cd94714e9d2682576147e0",
                "sha256": "54c2367e1dc8dc2ddeb61080faf96901e86f51dbcd068b112ef7cbdea1994110"
            },
            "downloads": -1,
            "filename": "gtap_extractor-0.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "4b70109958cd94714e9d2682576147e0",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 18678,
            "upload_time": "2024-11-11T16:56:30",
            "upload_time_iso_8601": "2024-11-11T16:56:30.373576Z",
            "url": "https://files.pythonhosted.org/packages/e0/13/3110cd275f92849cfcdb86c04a90bde35706ebccbb0a88496d734862bb7a/gtap_extractor-0.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-11 16:56:30",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "gtap-extractor"
}
        
Elapsed time: 0.40698s