Skip to main content

pygeoapi provides an API to geospatial data

Project description

pygeoapi

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
# install provider requirements accordingly from requirements-provider.txt
# install starlette requirements accordingly from requirements-starlette.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=$(pwd)/local.config.yml
# generate OpenAPI Document
pygeoapi generate-openapi-document -c local.config.yml > openapi.yml
export PYGEOAPI_OPENAPI=$(pwd)/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/openapi 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.

Please read the docker/README for details of the Docker implementation.

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.7.0.tar.gz (69.4 kB view details)

Uploaded Source

Built Distribution

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

pygeoapi-0.7.0-py2.py3-none-any.whl (114.9 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

  • Download URL: pygeoapi-0.7.0.tar.gz
  • Upload date:
  • Size: 69.4 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.7.0.tar.gz
Algorithm Hash digest
SHA256 0ac0fe7ab6c36be9f8f6f5174596fc981b2ce8be49af3dc264a4ebe7e23c59d0
MD5 6e8d9e93188b2312f038fb07525470d6
BLAKE2b-256 75b3afb6b8f5ae5ed114e8aa56526deabba5343d417379a721d495cacbf72fe9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pygeoapi-0.7.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 114.9 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.7.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 63eec0366f004162fda0e6ffafae56f781f691dd2fda69a75f05662cdc407068
MD5 2b25459f96487fa1898c61b4b1135294
BLAKE2b-256 dbb3b5466e950466373f80a43bbea6610b94bac43c5ce62115fe34105ec4bd44

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