pywdpa
Python interface to the World Database on Protected Areas.
https://github.com/ghislainv/pywdpa
Category: Biosphere
Sub Category: Conservation and Restoration
Keywords
api country-iso-code protected-areas protected-planet python-package shapefiles wdpa world
Last synced: about 5 hours ago
JSON representation
Repository metadata
📦🐍 pywda Python package for simple access to world's protected areas
- Host: GitHub
- URL: https://github.com/ghislainv/pywdpa
- Owner: ghislainv
- License: gpl-3.0
- Created: 2020-01-30T13:13:37.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2024-09-03T22:48:07.000Z (about 1 year ago)
- Last Synced: 2025-10-22T03:37:07.128Z (11 days ago)
- Topics: api, country-iso-code, protected-areas, protected-planet, python-package, shapefiles, wdpa, world
- Language: Python
- Homepage: https://ecology.ghislainv.fr/pywdpa
- Size: 3.79 MB
- Stars: 7
- Watchers: 1
- Forks: 1
- Open Issues: 1
- Releases: 5
-
Metadata Files:
- Readme: README.rst
- Changelog: CHANGELOG.rst
- Contributing: CONTRIBUTING.rst
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.rst
README.rst
..
# ==============================================================================
# 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
``_. 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
``_. The ``pywdpa`` package
translates some functions of the R package ``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: ``_.
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
``_. 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 `_.
GDAL
----
GDAL must be installed on your system.
To install GDAL on Windows, use the `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 `_ 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
`__. Anybody
who is interested can contribute to the package development following
our `Community guidelines
`__. Every
contributor must agree to follow the project's `Code of conduct
`__.
.. |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
Owner metadata
- Name: Ghislain Vieilledent
- Login: ghislainv
- Email:
- Kind: user
- Description: Researcher in ecology and applied statistics at Cirad
- Website: https://ecology.ghislainv.fr
- Location: Pacific / Noumea
- Twitter: ghislainv
- Company: Cirad
- Icon url: https://avatars.githubusercontent.com/u/4931332?u=d1e3de1f38eeb6fc74d6d4f8adc6285c961f5524&v=4
- Repositories: 85
- Last ynced at: 2024-06-11T15:35:38.821Z
- Profile URL: https://github.com/ghislainv
GitHub Events
Total
Last Year
Committers metadata
Last synced: 1 day ago
Total Commits: 91
Total Committers: 1
Avg Commits per committer: 91.0
Development Distribution Score (DDS): 0.0
Commits in past year: 0
Committers in past year: 0
Avg Commits per committer in past year: 0.0
Development Distribution Score (DDS) in past year: 0.0
| Name | Commits | |
|---|---|---|
| Ghislain Vieilledent | g****t@c****r | 91 |
Committer domains:
- cirad.fr: 1
Issue and Pull Request metadata
Last synced: about 1 month ago
Total issues: 0
Total pull requests: 12
Average time to close issues: N/A
Average time to close pull requests: less than a minute
Total issue authors: 0
Total pull request authors: 2
Average comments per issue: 0
Average comments per pull request: 0.0
Merged pull request: 11
Bot issues: 0
Bot pull requests: 1
Past year issues: 0
Past year pull requests: 1
Past year average time to close issues: N/A
Past year average time to close pull requests: N/A
Past year issue authors: 0
Past year pull request authors: 1
Past year average comments per issue: 0
Past year average comments per pull request: 0.0
Past year merged pull request: 0
Past year bot issues: 0
Past year bot pull requests: 1
Top Issue Authors
Top Pull Request Authors
- ghislainv (11)
- dependabot[bot] (2)
Top Issue Labels
Top Pull Request Labels
- dependencies (2)
Package metadata
- Total packages: 2
-
Total downloads:
- pypi: 341 last-month
- Total dependent packages: 1 (may contain duplicates)
- Total dependent repositories: 1 (may contain duplicates)
- Total versions: 14
- Total maintainers: 1
proxy.golang.org: github.com/ghislainv/pywdpa
- Homepage:
- Documentation: https://pkg.go.dev/github.com/ghislainv/pywdpa#section-documentation
- Licenses: gpl-3.0
- Latest release: v0.1.6 (published over 1 year ago)
- Last Synced: 2025-10-31T08:03:26.101Z (2 days ago)
- Versions: 6
- Dependent Packages: 0
- Dependent Repositories: 0
-
Rankings:
- Dependent packages count: 5.395%
- Average: 5.576%
- Dependent repos count: 5.758%
pypi.org: pywdpa
Easy access to world's protected areas
- Homepage: https://ecology.ghislainv.fr/pywdpa
- Documentation: https://ecology.ghislainv.fr/pywdpa
- Licenses: GPLv3
- Latest release: 0.1.6 (published over 1 year ago)
- Last Synced: 2025-10-31T08:03:26.773Z (2 days ago)
- Versions: 8
- Dependent Packages: 1
- Dependent Repositories: 1
- Downloads: 341 Last month
-
Rankings:
- Dependent packages count: 7.373%
- Stargazers count: 20.382%
- Average: 21.351%
- Dependent repos count: 22.233%
- Forks count: 22.782%
- Downloads: 33.988%
- Maintainers (1)
Dependencies
- gdal *
- numpy *
- requests *
- numpy *
- JamesIves/github-pages-deploy-action v4 composite
- actions/checkout v4 composite
- actions/setup-python v5 composite
- actions/checkout v4 composite
- actions/setup-python v5 composite
- actions/checkout v4 composite
- actions/download-artifact v3 composite
- actions/setup-python v5 composite
- actions/upload-artifact v3 composite
- pypa/gh-action-pypi-publish release/v1 composite
Score: 7.920083199053234