Skip to main content

High-level bindings to the Valhalla C++ library

Project description

Valhalla for Python

Master Push

This spin-off project simply offers packaged Python bindings to the fantastic Valhalla project.

Over time we will very likely deviate from Valhalla's own Python binding code to allow usages outside the scope of the core project. Refer to our release pattern to learn more about the versioning of this project.

Note, the performance boost using these bindings compared to requesting an HTTP service is tremendous: on 500 random routes in Berlin, the bindings take 27 secs while HTTP on localhost takes 127 secs.

Installation

pypi version

We distribute all 4 currently developed CPython versions as binary wheels for Win64, MacOS (Intel) and x86_64 Linux distributions with glibc>=2.24 (most modern systems, see PEP 600). We do not offer a source distribution on PyPI. Please contact us on enquiry@gis-ops.com if you need support building the bindings for your platform/distribution.

pip install pyvalhalla

Note, to install from PyPI as a Linux user you must have pip version 20.3 or greater installed.

Usage

Find a more extended notebook in ./examples, e.g. how to use the actor.

Before using the Python bindings you need to have access to a routable Valhalla graph. Either install Valhalla from source and built the graph from OSM compatible data or use our Valhalla docker image for a painless experience, e.g. this will build the routing graph for Andorra in ./custom_files:

docker run --rm --name valhalla_gis-ops -p 8002:8002 -v $PWD/custom_files:/custom_files -e tile_urls=https://download.geofabrik.de/europe/andorra-latest.osm.pbf gisops/valhalla:latest

Once you have created a graph locally, you can use it like this:

from valhalla import Actor, get_config, get_help

# generate configuration
config = get_config(tile_extract='./custom_files/valhalla_tiles.tar', verbose=True)

# print the help for specific config items (has the same structure as the output of get_config()
print(get_help()["service_limits"]["auto"]["max_distance"])

# instantiate Actor to load graph and call actions
actor = Actor(config)
route = actor.route({"locations": [...]})

License

pyvalhalla is licensed with GPLv2, see LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

pyvalhalla-3.0.3-cp310-cp310-win_amd64.whl (2.9 MB view details)

Uploaded CPython 3.10 Windows x86-64

pyvalhalla-3.0.3-cp310-cp310-manylinux_2_24_x86_64.whl (8.3 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.24+ x86-64

pyvalhalla-3.0.3-cp310-cp310-macosx_10_9_x86_64.whl (3.2 MB view details)

Uploaded CPython 3.10 macOS 10.9+ x86-64

pyvalhalla-3.0.3-cp39-cp39-win_amd64.whl (2.9 MB view details)

Uploaded CPython 3.9 Windows x86-64

pyvalhalla-3.0.3-cp39-cp39-manylinux_2_24_x86_64.whl (8.3 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.24+ x86-64

pyvalhalla-3.0.3-cp39-cp39-macosx_10_9_x86_64.whl (3.2 MB view details)

Uploaded CPython 3.9 macOS 10.9+ x86-64

pyvalhalla-3.0.3-cp38-cp38-win_amd64.whl (2.9 MB view details)

Uploaded CPython 3.8 Windows x86-64

pyvalhalla-3.0.3-cp38-cp38-manylinux_2_24_x86_64.whl (8.3 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.24+ x86-64

pyvalhalla-3.0.3-cp38-cp38-macosx_10_9_x86_64.whl (3.2 MB view details)

Uploaded CPython 3.8 macOS 10.9+ x86-64

pyvalhalla-3.0.3-cp37-cp37m-win_amd64.whl (2.9 MB view details)

Uploaded CPython 3.7m Windows x86-64

pyvalhalla-3.0.3-cp37-cp37m-manylinux_2_24_x86_64.whl (8.3 MB view details)

Uploaded CPython 3.7m manylinux: glibc 2.24+ x86-64

pyvalhalla-3.0.3-cp37-cp37m-macosx_10_9_x86_64.whl (3.2 MB view details)

Uploaded CPython 3.7m macOS 10.9+ x86-64

File details

Details for the file pyvalhalla-3.0.3-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for pyvalhalla-3.0.3-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 b402cb364003af45f48e105ab8be03ed35238b3f57c4905cd683ed23af8f96c5
MD5 c03decbe7239f19672b3f0e4bca8b3cf
BLAKE2b-256 d87d875e4731a40ba7bc8b73d329c4f713bc494776ad9dd7a71d8375a108c7c7

See more details on using hashes here.

File details

Details for the file pyvalhalla-3.0.3-cp310-cp310-manylinux_2_24_x86_64.whl.

File metadata

File hashes

Hashes for pyvalhalla-3.0.3-cp310-cp310-manylinux_2_24_x86_64.whl
Algorithm Hash digest
SHA256 8572f2dc41e6bc6119a4e5e75f56070887a21e7beb69e6845740d491042dbbc8
MD5 75ad9f3432b46734de4004cd66ad6fa4
BLAKE2b-256 ba2594c06f7b7f2588ced21c79e70230c8e1f9e3f06b9e5d36694a2bee428710

See more details on using hashes here.

File details

Details for the file pyvalhalla-3.0.3-cp310-cp310-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pyvalhalla-3.0.3-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 f4e4f24f853ad746c8679ff40f3a745cc8e340ae3c67d07c90ec8c022e80dcd0
MD5 1dca3856748eb865dfffeb67be507aaa
BLAKE2b-256 cb18d5636a4176c3c138c928a51ca54eed450286080b189596fd2dc0bf1bcaf6

See more details on using hashes here.

File details

Details for the file pyvalhalla-3.0.3-cp39-cp39-win_amd64.whl.

File metadata

File hashes

Hashes for pyvalhalla-3.0.3-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 c26a9f0f701f195810ede63dc154d136527d4a7ba074e3e7714e1a10ffb02633
MD5 bbdca1271ec6a17a8674de777daaffba
BLAKE2b-256 4ca0eb5dcf0b9f88cfd35ea39e74266165b66a9b8c22ac77efc849ae97a00886

See more details on using hashes here.

File details

Details for the file pyvalhalla-3.0.3-cp39-cp39-manylinux_2_24_x86_64.whl.

File metadata

File hashes

Hashes for pyvalhalla-3.0.3-cp39-cp39-manylinux_2_24_x86_64.whl
Algorithm Hash digest
SHA256 487bc1c39898abef96c714c22dcc8dea4b682ef8baf3ba49a2d4786b8e5255df
MD5 bb695f90eecb4eea808373135ed5aaf4
BLAKE2b-256 0881060e6bacb2131e8107b9de26f2f9f6a9ac9371e72f6cc4b56c7d7d361b92

See more details on using hashes here.

File details

Details for the file pyvalhalla-3.0.3-cp39-cp39-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pyvalhalla-3.0.3-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 639070d3efbca7cb7a02b05701bafa8638187a257f590ceae6a302c65bcf9b65
MD5 ec2bcd67b7f7dd6049f634ab9291a353
BLAKE2b-256 a19bd74783b121bdc30c7ef74ffc5b80213936ef2c3855d6dec35d7144546179

See more details on using hashes here.

File details

Details for the file pyvalhalla-3.0.3-cp38-cp38-win_amd64.whl.

File metadata

File hashes

Hashes for pyvalhalla-3.0.3-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 db328c2c559bc261a415e4b6d4345528bbac24e090e24cae1809bbef5fd172f9
MD5 ed3d80b209de1e86725d9c2566555679
BLAKE2b-256 c347981fba0c8235b47dc3a333221f28b20da4ce97d90059c80f093bb0c28c59

See more details on using hashes here.

File details

Details for the file pyvalhalla-3.0.3-cp38-cp38-manylinux_2_24_x86_64.whl.

File metadata

File hashes

Hashes for pyvalhalla-3.0.3-cp38-cp38-manylinux_2_24_x86_64.whl
Algorithm Hash digest
SHA256 c37ead5d3f675703b39f499c3e66b92d5efb075ad0f20ac040de15e4a0ea6bb1
MD5 4d1d60ce5b42908fff03bcf31032bbc5
BLAKE2b-256 6c9f5866ccc75020ab5c9f687d035150b9a016d551a5af73e3b8820b042651bd

See more details on using hashes here.

File details

Details for the file pyvalhalla-3.0.3-cp38-cp38-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pyvalhalla-3.0.3-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 e41061c7d7599b0f36b2dd3276427eee3d853aeab0a4fd859072aa656722f53e
MD5 ec3f6358b21d1ef8147fc8d8dced37d5
BLAKE2b-256 6284f741f17fedaca48c1a4698731f1d86414c9b77a281b90a23c1177c6bf7cd

See more details on using hashes here.

File details

Details for the file pyvalhalla-3.0.3-cp37-cp37m-win_amd64.whl.

File metadata

File hashes

Hashes for pyvalhalla-3.0.3-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 bb44a2d98e16994b1d2f557d4fd71b56bc433d6432a6e409ee1fd2416314d1e1
MD5 cf669808d892a901d575756be42dd682
BLAKE2b-256 b8501992c288640514d93fbe9c45f50d85a93fe1f2a617ad18a2ab7e219707f9

See more details on using hashes here.

File details

Details for the file pyvalhalla-3.0.3-cp37-cp37m-manylinux_2_24_x86_64.whl.

File metadata

File hashes

Hashes for pyvalhalla-3.0.3-cp37-cp37m-manylinux_2_24_x86_64.whl
Algorithm Hash digest
SHA256 bf7e6d33235b4986772e043d41de8c5048bd51285e3be1967a5284abd87168c9
MD5 9aac39f0a29be15edf1c58cd05ba7089
BLAKE2b-256 892c73d66f041b31a66692b1412bdb2bf05a8467e8dda4f548239de7ccdc402e

See more details on using hashes here.

File details

Details for the file pyvalhalla-3.0.3-cp37-cp37m-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for pyvalhalla-3.0.3-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 d5a601cb1cda3ccca7e44fc9aab2ce40d8f74f29a94b8de9f67893b28132f31c
MD5 87e67b63b1e5a833bc4d861c5489624e
BLAKE2b-256 092143c6481f2aeb30e4edbf0fa596f197b6ffe9a2d3506350b052cbc960daf4

See more details on using hashes here.

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