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

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

pyvalhalla-3.1.1-cp311-cp311-win_amd64.whl (2.7 MB view details)

Uploaded CPython 3.11Windows x86-64

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

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

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

Uploaded CPython 3.11macOS 10.15+ x86-64

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

Uploaded CPython 3.10Windows x86-64

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

Uploaded CPython 3.10manylinux: glibc 2.28+ x86-64

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

Uploaded CPython 3.10macOS 10.15+ x86-64

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

Uploaded CPython 3.9Windows x86-64

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

Uploaded CPython 3.9manylinux: glibc 2.28+ x86-64

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

Uploaded CPython 3.9macOS 10.15+ x86-64

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

Uploaded CPython 3.8Windows x86-64

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

Uploaded CPython 3.8manylinux: glibc 2.28+ x86-64

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

Uploaded CPython 3.8macOS 10.15+ x86-64

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

Uploaded CPython 3.7mWindows x86-64

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

Uploaded CPython 3.7mmanylinux: glibc 2.28+ x86-64

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

Uploaded CPython 3.7mmacOS 10.15+ x86-64

File details

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

File metadata

  • Download URL: pyvalhalla-3.1.1-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 2.7 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.3

File hashes

Hashes for pyvalhalla-3.1.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 f3ef1e3b73c52784f1d5e85679547adaf4bfbe9650bb86c47030d513e4747726
MD5 2f08d7a527a5d88e6d84205658dd78f9
BLAKE2b-256 621d9b29f036127fa109e7fc9e279ce4ba2223200b8a2a2892fcb3db6b0e753c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyvalhalla-3.1.1-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 04d825221f0d0720e03388d8a73e8bcd0509b3ab577b060960c02b913269abbe
MD5 34e9af4c7bfaefc96d3ae79ec92f8abe
BLAKE2b-256 11c589801e9c5c7cc1659b4675683711e04aa892f0cfa9926694cba2412b6fcd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyvalhalla-3.1.1-cp311-cp311-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 47d2f0d3de711f5ca772ff2cacdb45a62703563cc4a8c0e979679a5f6d50a000
MD5 c03869bdafeb7a3ce4369305e1b08130
BLAKE2b-256 8114745671f1c91a3c55c5f871a111de3131a28cd888a400b1af9b51e60c6d32

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyvalhalla-3.1.1-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 2.7 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

Hashes for pyvalhalla-3.1.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 bb60c4c185952f12aba747586d818c166d62c06399d127803bf524011954052e
MD5 9f63adb58bdc45826bf6a326afccb847
BLAKE2b-256 c073862f9746acc5c2b09df366654d011bb878a8d83a1441210dd65b8f9b9638

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyvalhalla-3.1.1-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 b902c08a167bd809d146be0bbebe0ff3cc5870c2d0520d9bb4bc9ad1964603bd
MD5 c6f704f970ec44cc3af155b8be80fcff
BLAKE2b-256 9cb61e5f85827dbc1eb161f76bac41aecc23caf109bdc962a58d1a71b92c53e3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyvalhalla-3.1.1-cp310-cp310-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 c4fbbc49c50cde0b2f69dab5252909200bd5c0d0999d214eaa27538513fde41a
MD5 4f6f65ff1d7859888e842c7a636d25b7
BLAKE2b-256 70e33ae2d0e0e0067557bad7f84f94443203efe5a05e70609396bbdb62f757d2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyvalhalla-3.1.1-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 2.7 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

Hashes for pyvalhalla-3.1.1-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 66d2f8cd9277517a224a11c7cc360bb036a3441990260a5619902faf81b5567b
MD5 f74190c94fb5dabb36bb1fc5a23900b3
BLAKE2b-256 6bacdf224976dcc574e0a93c851de85d6e62ef5cfb02aa0c907adeaab5a195ca

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyvalhalla-3.1.1-cp39-cp39-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 e8f75fd61475428d7cf2a1a8a6ce2dfaaabbb0f87150e1aeded3b797cc70fedf
MD5 bf7aa8faf2c2e32c98809ad0518f5e1a
BLAKE2b-256 8b4c0472f9457406e8ac04a9b87fa2a5f7d9dd9fef98cbe518ecab888ad54171

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyvalhalla-3.1.1-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 4bf97da81f907dbec31ee5db8bfb1fb98f6627d7c6b58e9c712e4a434f665465
MD5 7cb4b5e5396ba5eaa39283d6fc3592d3
BLAKE2b-256 0cfac91a7cffcefc58cc5e9fc91108806b9bf7d44692b98fa19c7dbd26be1a1d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyvalhalla-3.1.1-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 2.7 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

Hashes for pyvalhalla-3.1.1-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 f8f0b57a1283b4e754d5e69f991aef8c08360513d4feb7b7888033cff3f8f4a4
MD5 643e3b06f9a39ffd559ce58afeb2c68b
BLAKE2b-256 b4807c4d7d3d9cadff3932228a5432c8165e10bc71ecbb605a1d259e96aa6111

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyvalhalla-3.1.1-cp38-cp38-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ccbe698ac80c78aea68a7b54dde3afbfe4397663431d7dcc2e9b595d73863aaf
MD5 b8fb883cc3c61a39461c123b5e8cf112
BLAKE2b-256 0d41b7333620a28038c319e17ad34f3083d607f77a10d0ccdf4388506b316911

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyvalhalla-3.1.1-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 91eb769e80a9166a435c68ed6e7b41282778ccd0b14d7f6ca5b27b98746a6ee0
MD5 cb256081e0be527c45e794a325fa1c28
BLAKE2b-256 4a9fe4dfa8943c1ccb7938d9a4dfa1f618a0f0955c044f1cbdf0aa77b056472a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyvalhalla-3.1.1-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 2.7 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

Hashes for pyvalhalla-3.1.1-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 acd7bdaa06e5ef013011ff948a102e6cafbfcd4dd566eee5df22846e9395bc68
MD5 afd22a67aff382730862a8b1d13bfdae
BLAKE2b-256 5dd4f5ca6645038c5bdf37395006d8dee4eb4ae3249e14f46de44bf95dc6c48f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyvalhalla-3.1.1-cp37-cp37m-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 bd46050425b7ba9d6304de23e90af6f2d5edcbf3a911377c28e2738251a33f0d
MD5 7082c1cd82f1f7094f99d54123e951d1
BLAKE2b-256 5f5340062a8b211e9d7403a8df1949e4e2e98af5f55a21b5a8c1f867211b5615

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pyvalhalla-3.1.1-cp37-cp37m-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 08dc2dbe8f2fff71642a12c5f609e078a0b9d173ed4d4bbd1f455de72fe2fc92
MD5 1ca3edcccab70d025435b27085ce8e11
BLAKE2b-256 4056dc98f430400abee57b10182899275576a3262f31d0759cc26fae034e2858

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