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.1.0-cp311-cp311-win_amd64.whl (2.7 MB view details)

Uploaded CPython 3.11 Windows x86-64

pyvalhalla-3.1.0-cp311-cp311-manylinux_2_28_x86_64.whl (7.8 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.28+ x86-64

pyvalhalla-3.1.0-cp311-cp311-macosx_10_15_x86_64.whl (3.2 MB view details)

Uploaded CPython 3.11 macOS 10.15+ x86-64

pyvalhalla-3.1.0-cp310-cp310-win_amd64.whl (2.7 MB view details)

Uploaded CPython 3.10 Windows x86-64

pyvalhalla-3.1.0-cp310-cp310-manylinux_2_28_x86_64.whl (7.8 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.28+ x86-64

pyvalhalla-3.1.0-cp310-cp310-macosx_10_15_x86_64.whl (3.2 MB view details)

Uploaded CPython 3.10 macOS 10.15+ x86-64

pyvalhalla-3.1.0-cp39-cp39-win_amd64.whl (2.7 MB view details)

Uploaded CPython 3.9 Windows x86-64

pyvalhalla-3.1.0-cp39-cp39-manylinux_2_28_x86_64.whl (7.8 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.28+ x86-64

pyvalhalla-3.1.0-cp39-cp39-macosx_10_15_x86_64.whl (3.2 MB view details)

Uploaded CPython 3.9 macOS 10.15+ x86-64

pyvalhalla-3.1.0-cp38-cp38-win_amd64.whl (2.7 MB view details)

Uploaded CPython 3.8 Windows x86-64

pyvalhalla-3.1.0-cp38-cp38-manylinux_2_28_x86_64.whl (7.8 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.28+ x86-64

pyvalhalla-3.1.0-cp38-cp38-macosx_10_15_x86_64.whl (3.2 MB view details)

Uploaded CPython 3.8 macOS 10.15+ x86-64

pyvalhalla-3.1.0-cp37-cp37m-win_amd64.whl (2.7 MB view details)

Uploaded CPython 3.7m Windows x86-64

pyvalhalla-3.1.0-cp37-cp37m-manylinux_2_28_x86_64.whl (7.8 MB view details)

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

pyvalhalla-3.1.0-cp37-cp37m-macosx_10_15_x86_64.whl (3.2 MB view details)

Uploaded CPython 3.7m macOS 10.15+ x86-64

File details

Details for the file pyvalhalla-3.1.0-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for pyvalhalla-3.1.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 13287c619f2d8b116f74da77d7f6c61132d4bf32ec11c84a908fd71ed2a026a1
MD5 7acce38ae3796a08da0e4ffcb576bfd3
BLAKE2b-256 fa51602636015524d700a30f9f2eba7070fe19b79638c7a3be561993f4ed5f4e

See more details on using hashes here.

File details

Details for the file pyvalhalla-3.1.0-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyvalhalla-3.1.0-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 5677ad7ed3aaf873ead565f184359b08d3582d1ab5145aa55898b6b69beaa0e8
MD5 59fbcfb25e64fd6f24f7184fa713f266
BLAKE2b-256 7326b07f395a267c5dcef505f90c739b6a5e7dbe8db85971ce9c468c7d29c6c3

See more details on using hashes here.

File details

Details for the file pyvalhalla-3.1.0-cp311-cp311-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for pyvalhalla-3.1.0-cp311-cp311-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 05acba93fd2a3e7fefecedf7eab09201d7870d61667d0114e242c0f6286bfb55
MD5 a25d563efb0f160e98c2f23fd393c3bf
BLAKE2b-256 f4bf4a0bb9e3c4b14d498f0cf2ae20aef6d0e7122543213648f15f53b01903f7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyvalhalla-3.1.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 990b0eb0028b64d921ba45f2278cf310cc6bb04e51cc3a2cdff6916247ae59af
MD5 ce3d2d4c6b545578d6e64147ef1e58cb
BLAKE2b-256 7d212134003b9c510eb258d47c34e6f985f4a7763f8d4563b68c7e6e98f2723a

See more details on using hashes here.

File details

Details for the file pyvalhalla-3.1.0-cp310-cp310-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyvalhalla-3.1.0-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 946e107c761f3d8d0658f4939242a3dd8c37de599ce0b7bafe4053170e3e9351
MD5 270ef92b0563d17288bc43e0c070298a
BLAKE2b-256 844711404d9641e4bb9f828b83f7443794f634ad27daa51807a0d07d60478a21

See more details on using hashes here.

File details

Details for the file pyvalhalla-3.1.0-cp310-cp310-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for pyvalhalla-3.1.0-cp310-cp310-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 995d9d99be2ea55a0ad88d56e42d69d7cfb6a62bae0446e2fdf4d7306373c959
MD5 e1366d487a44d3e5c8016ff957933976
BLAKE2b-256 54f7acc654b491f3f4955bb7b07ff4af3a2b59e4580d300497c73713e488e89b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyvalhalla-3.1.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 e31ad905d686e6fc118ae0b3a5383e83d7e5182198d04995ca3f526fb1678cd5
MD5 a8a0a9bc2cc942b1ecade0dadd18b845
BLAKE2b-256 865e805d18462bef051099051f5b14b8d842d3e4ed0b367f9862f1a819025b13

See more details on using hashes here.

File details

Details for the file pyvalhalla-3.1.0-cp39-cp39-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyvalhalla-3.1.0-cp39-cp39-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 b8bc4539f89a9c45421f89eeba9c1ad80f3e7829261e72755e016b8529e3e866
MD5 4413f07cce2411238e0f6122e9747512
BLAKE2b-256 8bc3677355fa27583e3a767913a3b16b6c3f5dc13a80a2341ff8062153d02fff

See more details on using hashes here.

File details

Details for the file pyvalhalla-3.1.0-cp39-cp39-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for pyvalhalla-3.1.0-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 3a5d4664124a2154d38d75df215d3f402aeac4f1b97e459a2bd9fa69439f16c6
MD5 257faae21f0260af64787d297b108302
BLAKE2b-256 6797ddcf573b32827f339041abf634d77f3cdb54f2b6e8ff21e647d8d19eaed5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyvalhalla-3.1.0-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 20b1a6ab3a9f914f52757e6a1beedf8796c6c92e1520101a98ae5ab4f6ea7434
MD5 40cda6a7f0e2dc56f910779e1effec23
BLAKE2b-256 5d1c1516e5bf43730bc8b136f8e330ca28c02511e56dfe721a7bd56ebc063a81

See more details on using hashes here.

File details

Details for the file pyvalhalla-3.1.0-cp38-cp38-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyvalhalla-3.1.0-cp38-cp38-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 809a4bdbf9985659400a029bade869181cf606dbe2a3ad2c5f33cd5f648d73a6
MD5 53624bd6ddad9c0be9d18503a5bf8b48
BLAKE2b-256 1cd6d66d5dcde9ff522ab67a1346f78a24c3f44a61f4d52cc2c440b88feb91eb

See more details on using hashes here.

File details

Details for the file pyvalhalla-3.1.0-cp38-cp38-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for pyvalhalla-3.1.0-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 2195b2cbfed299fd9fe31eb73596df22b17641ca686a3113e45105c1ead3877e
MD5 d81b49a95a0445ae2b45bb967bbcb4ab
BLAKE2b-256 cc3f03d3f56b969563d192d969a9efee0f1a26240c702833f746c1957cea35f3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyvalhalla-3.1.0-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 149cbda8304c86086006c294d9593f083ac8e872041acf8e9b9e214a69871ddb
MD5 ab5f81dab585c7b5663225d9980b050b
BLAKE2b-256 044d996720e4521a7bfc94a04e4db0240e4adb429bf9a447b49c68bfe307b399

See more details on using hashes here.

File details

Details for the file pyvalhalla-3.1.0-cp37-cp37m-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyvalhalla-3.1.0-cp37-cp37m-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 91f2453e3d53d07c4cdeeb8788a1c60b6c66ef493da341d3bb506f2211d5da1f
MD5 8bb835b14fc83bb442ee1263eeb159fa
BLAKE2b-256 0eea3df79da78c1fd64008d042af02e033175d8dd21f8c078636fa619f661adc

See more details on using hashes here.

File details

Details for the file pyvalhalla-3.1.0-cp37-cp37m-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for pyvalhalla-3.1.0-cp37-cp37m-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 5b2835e017efd5515407726b4012e690cd9c2509b6e4b7dc11ac335f3fd7fdf6
MD5 94c953645884f5337665ea78d0c6744b
BLAKE2b-256 5ae21a849b026d3df38342908c2317ff6c3b7588dc3a0e8920bbc3c0b275c731

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