Skip to main content

pygeoapi provides an API to geospatial data

Project description

Build Status

pygeoapi provides an API to geospatial data

Installation

virtualenv -p python pygeoapi
cd pygeoapi
. bin/activate
git clone https://github.com/geopython/pygeoapi.git
cd pygeoapi
pip install -r requirements.txt
pip install -r requirements-dev.txt
pip install -e .
cp pygeoapi-config.yml local.config.yml
vi local.config.yml
# TODO: what is most important to edit?
export PYGEOAPI_CONFIG=/path/to/local.config.yml
# generate OpenAPI Document
pygeoapi generate-openapi-document -c local.config.yml > openapi.yml
export PYGEOAPI_OPENAPI=/path/to/openapi.yml
pygeoapi serve

Example requests

Try the swagger ui at http://localhost:5000/ui

or

# feature collection metadata
curl http://localhost:5000/
# conformance
curl http://localhost:5000/conformance
# feature collection
curl http://localhost:5000/collections/countries
# feature collection limit 100
curl http://localhost:5000/collections/countries/items?limit=100
# feature
curl http://localhost:5000/collections/countries/items/1
# number of hits
curl http://localhost:5000/collections/countries/items?resulttype=hits

Exploring with Swagger UI

docker pull swaggerapi/swagger-ui
docker run -p 80:8080 swaggerapi/swagger-ui
# go to http://localhost
# enter http://localhost:5000/api and click 'Explore'

Demo Server

There is a demo server on https://demo.pygeoapi.io running the latest (Docker) version from the master branch of this repo. pygeoapi runs there at https://demo.pygeoapi.io/master.

The demo server setup and config is maintained within a seperate GH repo: https://github.com/geopython/demo.pygeoapi.io.

Docker

Best/easiest way to run pygeoapi is to use Docker. On DockerHub pygeoapi Docker Images are available.

The version tagged latest is automatically built whenever code in the master branch of this GitHub repo changes (autobuild). This also cascades to updating the pygeoapi demo service. So the chain is:

(git push to master) --> (DockerHub Image autobuild) --> (demo server redeploy)

Please read the docker/README for details of the Docker implementation. To get started quickly several examples will get you up and running.

Unit Testing

Unit tests are run using pytest from the top project folder:

pytest tests

NB beware that some tests require Provider dependencies (libraries) to be available and that the ElasticSearch and Postgres tests require their respective backend servers running.

Environment variables are set in the file pytest.ini.

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

pygeoapi-0.6.0.tar.gz (34.1 kB view details)

Uploaded Source

Built Distribution

pygeoapi-0.6.0-py2.py3-none-any.whl (59.8 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file pygeoapi-0.6.0.tar.gz.

File metadata

  • Download URL: pygeoapi-0.6.0.tar.gz
  • Upload date:
  • Size: 34.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.19.1 CPython/3.6.8

File hashes

Hashes for pygeoapi-0.6.0.tar.gz
Algorithm Hash digest
SHA256 852beb2fc0b2105f72b9c0bec9144cdbae00eaae7632b13af7d72705c489d48d
MD5 164cce346703a438d5581b16864173fb
BLAKE2b-256 513216c61dba3492eb931b2a25e260a05392f3ce3df467fd5e4b21c372485c3b

See more details on using hashes here.

Provenance

File details

Details for the file pygeoapi-0.6.0-py2.py3-none-any.whl.

File metadata

  • Download URL: pygeoapi-0.6.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 59.8 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.19.1 CPython/3.6.8

File hashes

Hashes for pygeoapi-0.6.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 c2064584929a69e9c73e508dec428ec5132649d5b8b1dd7f97f967c349d30c94
MD5 268a91000176164ef1860ea546947989
BLAKE2b-256 59816d6f90bf1bbb22578dff079bfd74aaa2d496a79680666e8bf7c24e121cf3

See more details on using hashes here.

Provenance

Supported by

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