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 currently maintained CPython versions as binary wheels for Win64, MacOS (Intel) and x86_64 Linux distributions with glibc>=2.28. 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.2.0-cp311-cp311-win_amd64.whl (2.7 MB view details)

Uploaded CPython 3.11 Windows x86-64

pyvalhalla-3.2.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.2.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.2.0-cp310-cp310-win_amd64.whl (2.7 MB view details)

Uploaded CPython 3.10 Windows x86-64

pyvalhalla-3.2.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.2.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.2.0-cp39-cp39-win_amd64.whl (2.7 MB view details)

Uploaded CPython 3.9 Windows x86-64

pyvalhalla-3.2.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.2.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.2.0-cp38-cp38-win_amd64.whl (2.7 MB view details)

Uploaded CPython 3.8 Windows x86-64

pyvalhalla-3.2.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.2.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.2.0-cp37-cp37m-win_amd64.whl (2.7 MB view details)

Uploaded CPython 3.7m Windows x86-64

pyvalhalla-3.2.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.2.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.2.0-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for pyvalhalla-3.2.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 b018336a32efd9178ba76ae5df14ea7953231205c309e170e500487dba0ab096
MD5 4e7ebf5897a2e28e970494530aafdae2
BLAKE2b-256 8ff48081e0e212a5279a348a4c71fa6798c5aa8f86622ecb07943c2f9ce824c6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyvalhalla-3.2.0-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 38b2366d1e7a41927f332f9877889ed74b6f6b61195fa6e70b8477169bd677f4
MD5 40789ade99edf7215766396040817fb4
BLAKE2b-256 0e9a0e5bfd515e62c669413052893014f09e615ce0d7339fe9c7450797f42659

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyvalhalla-3.2.0-cp311-cp311-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 2f10ece9c9a4dc67cbe967686d4125d39c03b8b1f0f0a06111a9ba69d3026a48
MD5 4ffd08694dc2ed51f9c6ae6a6195441f
BLAKE2b-256 6750ebd67d0d19bdf9445e07ad66f2e971b45151f6367823f6336d205b9496aa

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyvalhalla-3.2.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 ee2f2d922ac700e3f436026fe571b069248349df136922ed5bd798117562a933
MD5 f86631a02658b73eb2e2affac85b1513
BLAKE2b-256 af9684db8b654fcc48229844bc04e08fa70d3b8dde6728926fbce63e03924a95

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyvalhalla-3.2.0-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 236a830cab7a99e9d30d678596dbfc3ebb70f4683f96a4e67efffbfc3989374b
MD5 86d2b304b5ffc6188a85a37d21e61e4a
BLAKE2b-256 6fb27a36d3b16f3e4d5c498bf93ba73dc5d9d2e213ddfbffe04fda04324c0053

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyvalhalla-3.2.0-cp310-cp310-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 e4f01846cde7cf68a3599e97e0fe9e8304d53c8a9932d80c1845828fed2391d2
MD5 92476c6c0d0780acde86e2af6bf3e541
BLAKE2b-256 600fd62584e8e3943b05155efb9dcc508656f2f41e6daecb2d96cc214b57ff03

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyvalhalla-3.2.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 cb7d9da29f38a2da797069006e27b91c7ea84cba58b1c5e571a12d27893fcb20
MD5 8e0873eae117164da0ea24109c2a9df5
BLAKE2b-256 153d366298ac7aecbb566e9d346530dfec58ca5b652e7c230e6a4c12cb9ac1b5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyvalhalla-3.2.0-cp39-cp39-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 408da8af2d8c6396dda4cd68555afdc7e2ff8fbab02131ee31517028fa319673
MD5 0179baefa92e18cb728f217298689828
BLAKE2b-256 0de004f5efbce803887aac175fbdf048b68488cdf7fb1f850ff6d7c64c290e4a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyvalhalla-3.2.0-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 85234b510b32e7cc5a6ef7fafab47c4b83082a8507b7304458b544208766081e
MD5 f10be22e3d1049f6507de0fb47b3926e
BLAKE2b-256 d2697e41bebd6e86d2a984795a5246a6c04e903915ef06a6de1ac2bafdce1b14

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyvalhalla-3.2.0-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 c209d5b1e41520c49857a25dc430cadb505bf54741bf2e057c27c8525dda9e96
MD5 0821639f7c9c7eb5309d1dc6f9f2e183
BLAKE2b-256 52dbacf577c1a66519d57bc9ac83617fadd0a369ae02e088869e4bab4af87f62

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyvalhalla-3.2.0-cp38-cp38-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 f73d51087731b0b13b3fded0653bfe565fa38d441b50ee28337ad409f80b917a
MD5 be280d1c775d7ddb2cde9d88537b2bac
BLAKE2b-256 a4aa81bfd012b0c251f23dd2c2d04372d4c4517fb117f7d78817d69de18842d5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyvalhalla-3.2.0-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 f37e194a045094309719bbe9464bcb55fe41977b6cbeffbebd33a02d4c204f4e
MD5 c6d446189d7ebf5bcf8a76dd73cbe24d
BLAKE2b-256 4d6a09d9f839a3889dcf2892ee2986e81592491c46a131bdcbcd853f8f52ff3b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyvalhalla-3.2.0-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 8a644b7d7dc8abd8acc86c08a836c724517edf9199447f3bb37f80e91ccb278c
MD5 d65200f39bb8b38b443dbc492ae8306b
BLAKE2b-256 976625269bbf43d79b3ea1919ce988322ad7e6d3dbc346849a9a5b844e5494a2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyvalhalla-3.2.0-cp37-cp37m-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 3e16068503bc5cba7cf8737a692b3aaae75a71f0ce457bad53efb19450047553
MD5 8f59938d1cfb4832da88a3aab9a715cb
BLAKE2b-256 fb0e8effe28aeff624a8521d7acf256f0090711ecff9140338b70641c1d7fcf4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyvalhalla-3.2.0-cp37-cp37m-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 ba647d5955c0c1344908047644d01b2425a4b98f2b679e02dc1936c2599a7045
MD5 089c894757257ff06cb272a1df73fa3b
BLAKE2b-256 724440f5ebc0b69df853e73207af79f3cb5cb1f68b5a2b9d6520598857c198d7

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