High-level bindings to the Valhalla C++ library
Project description
Valhalla for Python
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
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
File details
Details for the file pyvalhalla-3.0.4-cp310-cp310-win_amd64.whl
.
File metadata
- Download URL: pyvalhalla-3.0.4-cp310-cp310-win_amd64.whl
- Upload date:
- Size: 2.9 MB
- Tags: CPython 3.10, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5e63c45b6b826050367a4893e51aebb1ee184969a9bc2f2ed0fd096300168e9b |
|
MD5 | 52ac1d570e4b5fde0d4f69847b01c617 |
|
BLAKE2b-256 | 7ecd6c6625eed58e3a53c1f741a2562d918e96950f17c3251d9b8c60691c2407 |
File details
Details for the file pyvalhalla-3.0.4-cp310-cp310-manylinux_2_24_x86_64.whl
.
File metadata
- Download URL: pyvalhalla-3.0.4-cp310-cp310-manylinux_2_24_x86_64.whl
- Upload date:
- Size: 8.3 MB
- Tags: CPython 3.10, manylinux: glibc 2.24+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 76a5f8d49123fa710394306cd5972919bd638aa9882a1a981ab528148d1a1bf4 |
|
MD5 | 0afeb11dafd52a7bab4b4938ddf2ae32 |
|
BLAKE2b-256 | 603500495f217ee8a181af6e9f701582eacae5578922d953434f9a464605867e |
File details
Details for the file pyvalhalla-3.0.4-cp310-cp310-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: pyvalhalla-3.0.4-cp310-cp310-macosx_10_9_x86_64.whl
- Upload date:
- Size: 3.2 MB
- Tags: CPython 3.10, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ee6405d66e052844a98c536fc13f9b66063cc8ef84df75e1ab54882021708968 |
|
MD5 | 8e2697da571f89082cceef8cd7e8c09c |
|
BLAKE2b-256 | 19602f54e910d82cf605cedc595e9324634df089231ee01cbfe81a38d72ff4d0 |
File details
Details for the file pyvalhalla-3.0.4-cp39-cp39-win_amd64.whl
.
File metadata
- Download URL: pyvalhalla-3.0.4-cp39-cp39-win_amd64.whl
- Upload date:
- Size: 2.9 MB
- Tags: CPython 3.9, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 55950ae2ed04016a9dd87246d6c7ccb876501a723720cfd0601a08fcd18daa09 |
|
MD5 | 081a2eb010383c66afd8c94bb45f3b4c |
|
BLAKE2b-256 | 63640bfd237a028dedfb691542bcbd721b6d032755d7cbf052159ea3d6f2223e |
File details
Details for the file pyvalhalla-3.0.4-cp39-cp39-manylinux_2_24_x86_64.whl
.
File metadata
- Download URL: pyvalhalla-3.0.4-cp39-cp39-manylinux_2_24_x86_64.whl
- Upload date:
- Size: 8.3 MB
- Tags: CPython 3.9, manylinux: glibc 2.24+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cc58bff2dc410b6d5229f6c5468d447de6ddea4622d4c075c0982883b6c7e533 |
|
MD5 | 34c72ff3e319fdbf3aefb97e3fa8c610 |
|
BLAKE2b-256 | 12e595983250fa2111fa3b761246f81e309b258cbe230d6c5f6aeff5338abb3f |
File details
Details for the file pyvalhalla-3.0.4-cp39-cp39-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: pyvalhalla-3.0.4-cp39-cp39-macosx_10_9_x86_64.whl
- Upload date:
- Size: 3.2 MB
- Tags: CPython 3.9, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5d7e5585de2bf75aadfb8ef568746106764dfca3403c9ac84b4012704e0a1f7f |
|
MD5 | 7e8d7e8be3f47e0d24720fdda2eb36c4 |
|
BLAKE2b-256 | 052ecedb9d78f689103d9b58ab13f6a5437a020538f9edd3876172b0d002851a |
File details
Details for the file pyvalhalla-3.0.4-cp38-cp38-win_amd64.whl
.
File metadata
- Download URL: pyvalhalla-3.0.4-cp38-cp38-win_amd64.whl
- Upload date:
- Size: 2.9 MB
- Tags: CPython 3.8, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 652c801827fc06b7efedada6c7be4bbe32395e0de915975201ba231f38fbda8e |
|
MD5 | 9fe1ec57e1a130110da5139e7d24b877 |
|
BLAKE2b-256 | 4cfa0e47b1b00f7cceb327b7f67de490cf43c05a63f622670585c4fd7e6b5288 |
File details
Details for the file pyvalhalla-3.0.4-cp38-cp38-manylinux_2_24_x86_64.whl
.
File metadata
- Download URL: pyvalhalla-3.0.4-cp38-cp38-manylinux_2_24_x86_64.whl
- Upload date:
- Size: 8.3 MB
- Tags: CPython 3.8, manylinux: glibc 2.24+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ccb4d867bb1ac827dd69b13860f760eae1e4fb61bfb6b8e2b82c3fd0b4abec14 |
|
MD5 | 0fbfe747091edd9ae2f394b663ae8e37 |
|
BLAKE2b-256 | d4f991a6d3618bc44dc856f53d04aee9199d05a362a5a7983179ff65f337a3ee |
File details
Details for the file pyvalhalla-3.0.4-cp38-cp38-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: pyvalhalla-3.0.4-cp38-cp38-macosx_10_9_x86_64.whl
- Upload date:
- Size: 3.2 MB
- Tags: CPython 3.8, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ba393329ce39ce41097e542cfe0d65cd098b5cbf9225b6b681a7e8108b8dd8c0 |
|
MD5 | e735356f8b358f6a574865d775692248 |
|
BLAKE2b-256 | 5d11158ec6157a9ed5b6c60348b690edcfe15367086057bae608d2d172f4f4ae |
File details
Details for the file pyvalhalla-3.0.4-cp37-cp37m-win_amd64.whl
.
File metadata
- Download URL: pyvalhalla-3.0.4-cp37-cp37m-win_amd64.whl
- Upload date:
- Size: 2.9 MB
- Tags: CPython 3.7m, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7a6c7f82f315ea4e62ae2477a349a3a2a9e55ea4bb6e623b37ae9f232f4e8672 |
|
MD5 | 0de3d35e7fea9683d13015c4c86e07ee |
|
BLAKE2b-256 | d7c70848bcc96e819c5871527b7e085f4078b596ad626a0003b2da475caed6b2 |
File details
Details for the file pyvalhalla-3.0.4-cp37-cp37m-manylinux_2_24_x86_64.whl
.
File metadata
- Download URL: pyvalhalla-3.0.4-cp37-cp37m-manylinux_2_24_x86_64.whl
- Upload date:
- Size: 8.3 MB
- Tags: CPython 3.7m, manylinux: glibc 2.24+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1a984f82bd3e237ebd176de3b6c58b1d28fcb90a625c51d906b4fcd473b2bf77 |
|
MD5 | b17d180391879766d31644b63335e82d |
|
BLAKE2b-256 | ffb80b1673231090f11700543ef778937ed8ede9b7dafa719185d1c74e09432b |
File details
Details for the file pyvalhalla-3.0.4-cp37-cp37m-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: pyvalhalla-3.0.4-cp37-cp37m-macosx_10_9_x86_64.whl
- Upload date:
- Size: 3.2 MB
- Tags: CPython 3.7m, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 05fe4c8114c0a6cc2b948a8c187aeaba1d141a96dd306fc384c319cde88eb1fb |
|
MD5 | 4b5d3e731fb3d0505b66d2c4193d6775 |
|
BLAKE2b-256 | 6577e1222fa5c745d43b1d03a4d0f25c88fd8829062b663ce31c9e023b52d286 |