pywdpa


Namepywdpa JSON
Version 0.1.6 PyPI version JSON
download
home_pagehttps://ecology.ghislainv.fr/pywdpa
SummaryEasy access to world's protected areas
upload_time2024-05-23 07:31:19
maintainerNone
docs_urlNone
authorGhislain Vieilledent
requires_python>=3.6
licenseGPLv3
keywords protected areas wdpa world database protected areas
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ..
   # ==============================================================================
   # author          :Ghislain Vieilledent
   # email           :ghislain.vieilledent@cirad.fr, ghislainv@gmail.com
   # web             :https://ecology.ghislainv.fr
   # license         :GPLv3
   # ==============================================================================

.. image:: https://ecology.ghislainv.fr/pywdpa/_static/logo-pywdpa.svg
   :align: right
   :target: https://ecology.ghislainv.fr/pywdpa
   :alt: Logo pywdpa
   :width: 140px
	   
``pywdpa`` Python package
*************************


|Python version| |PyPI version| |GitHub Actions| |License| |Zenodo|


Overview
========

The ``pywdpa`` Python package is an interface to the World Database on
Protected Areas (WDPA) hosted on the Protected Planet website at
`<https://www.protectedplanet.net>`_. The ``pywdpa`` package provides
functions to download shapefiles of protected areas (PA) for any
countries with an iso3 code using the Protected Planet API at
`<https://api.protectedplanet.net>`_. The ``pywdpa`` package
translates some functions of the R package ``worldpa``
(`<https://github.com/FRBCesab/worldpa>`_) in the Python language.

.. image:: https://ecology.ghislainv.fr/pywdpa/_static/banner_pywdpa.png
   :align: center
   :target: https://ecology.ghislainv.fr/pywdpa
   :alt: protected-planet

Terms and conditions
====================

You must ensure that the following citation is always clearly
reproduced in any publication or analysis involving the Protected
Planet Materials in any derived form or format:

..
   
    UNEP-WCMC and IUCN (\ ``YEAR``\ ) Protected Planet: The World
    Database on Protected Areas (WDPA). Cambridge, UK: UNEP-WCMC and
    IUCN. Available at: www.protectedplanet.net (dataset downloaded the
    ``YEAR/MONTH``\ ).


For further details on terms and conditions of the WDPA usage, please
visit the page: `<https://www.protectedplanet.net/en/legal>`_.

Prerequisites
=============

Access to Protected Planet API
------------------------------

This package uses the Protected Planet API to access data on world
protected areas. You must first have obtained a Personal API Token by
filling in the form available at
`<https://api.protectedplanet.net/request>`_. Then you need to set an
environment variable (we recommend using the name ``WDPA_KEY``\ )
using either the command ``os.environ["WDPA_KEY"]="your_token"`` or
`python-dotenv <https://github.com/theskumar/python-dotenv>`_.

GDAL
----

GDAL must be installed on your system.

To install GDAL on Windows, use the `OSGeo4W <https://trac.osgeo.org/osgeo4w/>`_ network installer. OSGeo4W is a binary distribution of a broad set of open source geospatial software for Windows environments (Windows 11 down to 7). Select *Express Install* and install GDAL. Several Gb of space will be needed on disk to install this programs. This will also install *OSGeo4W Shell* to execute command lines.

To install GDAL on other systems, use your package manager, for example ``apt`` for Debian/Ubuntu Linux distributions.

.. code:: shell

    sudo apt update
    sudo apt install gdal-bin libgdal-dev

After installing GDAL, you can test the installation by running ``gdalinfo --version`` in the command prompt or terminal, which should display the installed GDAL version.


Installation
============

The easiest way to install the ``pywdpa`` Python package is via `pip <https://pip.pypa.io/en/stable/>`_ in the *OSGeo4W Shell* for Windows or in a virtual environment for Linux.

For Linux, create and activate a virtual environment before install ``pywdpa`` with ``pip``:

.. code-block:: shell

   cd ~
   # Create a directory for virtual environments
   mkdir venvs
   # Create the virtual environment with venv
   python3 -m venv ~/venvs/venv-pywdpa
   # Activate (start) the virtual environment
   source ~/venvs/venv-pywdpa/bin/activate

Install Python dependencies and ``pywdpa`` in the *OSGeo4W Shell* or in the newly created virtual environment:
   
.. code-block:: shell
   
   # Upgrade pip, setuptools, and wheel
   python3 -m pip install --upgrade pip setuptools wheel
   # Install numpy
   python3 -m numpy
   # Install gdal Python bindings (the correct version)
   python3 -m pip install gdal==$(gdal-config --version)
   # Install pywdpa. This will install all other dependencies
   python3 -m pip install pywdpa

If you want to install the development version of ``pywdpa``, replace the last line with:

.. code-block:: shell

   python3 -m pip install https://github.com/ghislainv/pywdpa/archive/master.zip

To deactivate and delete the virtual environment:

.. code-block:: shell
		
   deactivate
   rm -R ~/venvs/venv-pywdpa # Just remove the repository

In case of problem while installing GDAL Python bindings, try the following command:

.. code-block:: shell
		
   python3 -m pip install  --no-cache-dir --force-reinstall gdal==$(gdal-config --version)


Contributing
============

The ``pywdpa`` Python package is Open Source and released under
the `GNU GPL version 3 license
<https://ecology.ghislainv.fr/pywdpa/license.html>`__. Anybody
who is interested can contribute to the package development following
our `Community guidelines
<https://ecology.ghislainv.fr/pywdpa/contributing.html>`__. Every
contributor must agree to follow the project's `Code of conduct
<https://ecology.ghislainv.fr/pywdpa/code_of_conduct.html>`__.
   
.. |Python version| image:: https://img.shields.io/pypi/pyversions/pywdpa?logo=python&logoColor=ffd43b&color=306998
   :target: https://pypi.org/project/pywdpa
   :alt: Python version

.. |PyPI version| image:: https://img.shields.io/pypi/v/pywdpa
   :target: https://pypi.org/project/pywdpa
   :alt: PyPI version

.. |GitHub Actions| image:: https://github.com/ghislainv/pywdpa/workflows/PyPkg/badge.svg
   :target: https://github.com/ghislainv/pywdpa/actions
   :alt: GitHub Actions
	 
.. |License| image:: https://img.shields.io/badge/licence-GPLv3-8f10cb.svg
   :target: https://www.gnu.org/licenses/gpl-3.0.html
   :alt: License GPLv3

.. |Zenodo| image:: https://zenodo.org/badge/DOI/10.5281/zenodo.4275513.svg
   :target: https://doi.org/10.5281/zenodo.4275513
   :alt: Zenodo


            

Raw data

            {
    "_id": null,
    "home_page": "https://ecology.ghislainv.fr/pywdpa",
    "name": "pywdpa",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": "protected areas wdpa world database protected areas",
    "author": "Ghislain Vieilledent",
    "author_email": "ghislain.vieilledent@cirad.fr",
    "download_url": "https://files.pythonhosted.org/packages/b3/8f/706c3d4679fd3c4a5c6c4a3c18ec500d88bd9d3e45ffa6fd522499257803/pywdpa-0.1.6.tar.gz",
    "platform": null,
    "description": "..\n   # ==============================================================================\n   # author          :Ghislain Vieilledent\n   # email           :ghislain.vieilledent@cirad.fr, ghislainv@gmail.com\n   # web             :https://ecology.ghislainv.fr\n   # license         :GPLv3\n   # ==============================================================================\n\n.. image:: https://ecology.ghislainv.fr/pywdpa/_static/logo-pywdpa.svg\n   :align: right\n   :target: https://ecology.ghislainv.fr/pywdpa\n   :alt: Logo pywdpa\n   :width: 140px\n\t   \n``pywdpa`` Python package\n*************************\n\n\n|Python version| |PyPI version| |GitHub Actions| |License| |Zenodo|\n\n\nOverview\n========\n\nThe ``pywdpa`` Python package is an interface to the World Database on\nProtected Areas (WDPA) hosted on the Protected Planet website at\n`<https://www.protectedplanet.net>`_. The ``pywdpa`` package provides\nfunctions to download shapefiles of protected areas (PA) for any\ncountries with an iso3 code using the Protected Planet API at\n`<https://api.protectedplanet.net>`_. The ``pywdpa`` package\ntranslates some functions of the R package ``worldpa``\n(`<https://github.com/FRBCesab/worldpa>`_) in the Python language.\n\n.. image:: https://ecology.ghislainv.fr/pywdpa/_static/banner_pywdpa.png\n   :align: center\n   :target: https://ecology.ghislainv.fr/pywdpa\n   :alt: protected-planet\n\nTerms and conditions\n====================\n\nYou must ensure that the following citation is always clearly\nreproduced in any publication or analysis involving the Protected\nPlanet Materials in any derived form or format:\n\n..\n   \n    UNEP-WCMC and IUCN (\\ ``YEAR``\\ ) Protected Planet: The World\n    Database on Protected Areas (WDPA). Cambridge, UK: UNEP-WCMC and\n    IUCN. Available at: www.protectedplanet.net (dataset downloaded the\n    ``YEAR/MONTH``\\ ).\n\n\nFor further details on terms and conditions of the WDPA usage, please\nvisit the page: `<https://www.protectedplanet.net/en/legal>`_.\n\nPrerequisites\n=============\n\nAccess to Protected Planet API\n------------------------------\n\nThis package uses the Protected Planet API to access data on world\nprotected areas. You must first have obtained a Personal API Token by\nfilling in the form available at\n`<https://api.protectedplanet.net/request>`_. Then you need to set an\nenvironment variable (we recommend using the name ``WDPA_KEY``\\ )\nusing either the command ``os.environ[\"WDPA_KEY\"]=\"your_token\"`` or\n`python-dotenv <https://github.com/theskumar/python-dotenv>`_.\n\nGDAL\n----\n\nGDAL must be installed on your system.\n\nTo install GDAL on Windows, use the `OSGeo4W <https://trac.osgeo.org/osgeo4w/>`_ network installer. OSGeo4W is a binary distribution of a broad set of open source geospatial software for Windows environments (Windows 11 down to 7). Select *Express Install* and install GDAL. Several Gb of space will be needed on disk to install this programs. This will also install *OSGeo4W Shell* to execute command lines.\n\nTo install GDAL on other systems, use your package manager, for example ``apt`` for Debian/Ubuntu Linux distributions.\n\n.. code:: shell\n\n    sudo apt update\n    sudo apt install gdal-bin libgdal-dev\n\nAfter installing GDAL, you can test the installation by running ``gdalinfo --version`` in the command prompt or terminal, which should display the installed GDAL version.\n\n\nInstallation\n============\n\nThe easiest way to install the ``pywdpa`` Python package is via `pip <https://pip.pypa.io/en/stable/>`_ in the *OSGeo4W Shell* for Windows or in a virtual environment for Linux.\n\nFor Linux, create and activate a virtual environment before install ``pywdpa`` with ``pip``:\n\n.. code-block:: shell\n\n   cd ~\n   # Create a directory for virtual environments\n   mkdir venvs\n   # Create the virtual environment with venv\n   python3 -m venv ~/venvs/venv-pywdpa\n   # Activate (start) the virtual environment\n   source ~/venvs/venv-pywdpa/bin/activate\n\nInstall Python dependencies and ``pywdpa`` in the *OSGeo4W Shell* or in the newly created virtual environment:\n   \n.. code-block:: shell\n   \n   # Upgrade pip, setuptools, and wheel\n   python3 -m pip install --upgrade pip setuptools wheel\n   # Install numpy\n   python3 -m numpy\n   # Install gdal Python bindings (the correct version)\n   python3 -m pip install gdal==$(gdal-config --version)\n   # Install pywdpa. This will install all other dependencies\n   python3 -m pip install pywdpa\n\nIf you want to install the development version of ``pywdpa``, replace the last line with:\n\n.. code-block:: shell\n\n   python3 -m pip install https://github.com/ghislainv/pywdpa/archive/master.zip\n\nTo deactivate and delete the virtual environment:\n\n.. code-block:: shell\n\t\t\n   deactivate\n   rm -R ~/venvs/venv-pywdpa # Just remove the repository\n\nIn case of problem while installing GDAL Python bindings, try the following command:\n\n.. code-block:: shell\n\t\t\n   python3 -m pip install  --no-cache-dir --force-reinstall gdal==$(gdal-config --version)\n\n\nContributing\n============\n\nThe ``pywdpa`` Python package is Open Source and released under\nthe `GNU GPL version 3 license\n<https://ecology.ghislainv.fr/pywdpa/license.html>`__. Anybody\nwho is interested can contribute to the package development following\nour `Community guidelines\n<https://ecology.ghislainv.fr/pywdpa/contributing.html>`__. Every\ncontributor must agree to follow the project's `Code of conduct\n<https://ecology.ghislainv.fr/pywdpa/code_of_conduct.html>`__.\n   \n.. |Python version| image:: https://img.shields.io/pypi/pyversions/pywdpa?logo=python&logoColor=ffd43b&color=306998\n   :target: https://pypi.org/project/pywdpa\n   :alt: Python version\n\n.. |PyPI version| image:: https://img.shields.io/pypi/v/pywdpa\n   :target: https://pypi.org/project/pywdpa\n   :alt: PyPI version\n\n.. |GitHub Actions| image:: https://github.com/ghislainv/pywdpa/workflows/PyPkg/badge.svg\n   :target: https://github.com/ghislainv/pywdpa/actions\n   :alt: GitHub Actions\n\t \n.. |License| image:: https://img.shields.io/badge/licence-GPLv3-8f10cb.svg\n   :target: https://www.gnu.org/licenses/gpl-3.0.html\n   :alt: License GPLv3\n\n.. |Zenodo| image:: https://zenodo.org/badge/DOI/10.5281/zenodo.4275513.svg\n   :target: https://doi.org/10.5281/zenodo.4275513\n   :alt: Zenodo\n\n",
    "bugtrack_url": null,
    "license": "GPLv3",
    "summary": "Easy access to world's protected areas",
    "version": "0.1.6",
    "project_urls": {
        "Documentation": "https://ecology.ghislainv.fr/pywdpa",
        "Homepage": "https://ecology.ghislainv.fr/pywdpa",
        "Source": "https://github.com/ghislainv/pywdpa/",
        "Traker": "https://github.com/ghislainv/pywdpa/issues"
    },
    "split_keywords": [
        "protected",
        "areas",
        "wdpa",
        "world",
        "database",
        "protected",
        "areas"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a280d66146e188e9d7552bbff2ec631638a3c2e66f699a839baa27f66e8d72da",
                "md5": "4d4b5fe5132030725e1457130d7adfd2",
                "sha256": "cac4c0dc6ba9e61ac39fdcf1894756dc1ab264b66aa4da716c052f9b6803b68a"
            },
            "downloads": -1,
            "filename": "pywdpa-0.1.6-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "4d4b5fe5132030725e1457130d7adfd2",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": ">=3.6",
            "size": 20853,
            "upload_time": "2024-05-23T07:31:18",
            "upload_time_iso_8601": "2024-05-23T07:31:18.507464Z",
            "url": "https://files.pythonhosted.org/packages/a2/80/d66146e188e9d7552bbff2ec631638a3c2e66f699a839baa27f66e8d72da/pywdpa-0.1.6-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b38f706c3d4679fd3c4a5c6c4a3c18ec500d88bd9d3e45ffa6fd522499257803",
                "md5": "58a5b8a013673338ca86f6d87c47e04d",
                "sha256": "898603da8bc25d288db9dbf5537cf46d8d7c953b5a6b0348422aa912a0e80ff5"
            },
            "downloads": -1,
            "filename": "pywdpa-0.1.6.tar.gz",
            "has_sig": false,
            "md5_digest": "58a5b8a013673338ca86f6d87c47e04d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 22420,
            "upload_time": "2024-05-23T07:31:19",
            "upload_time_iso_8601": "2024-05-23T07:31:19.746539Z",
            "url": "https://files.pythonhosted.org/packages/b3/8f/706c3d4679fd3c4a5c6c4a3c18ec500d88bd9d3e45ffa6fd522499257803/pywdpa-0.1.6.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-05-23 07:31:19",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "ghislainv",
    "github_project": "pywdpa",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "pywdpa"
}
        
Elapsed time: 0.24050s