pyvalhalla


Namepyvalhalla JSON
Version 3.2.0 PyPI version JSON
download
home_pagehttps://github.com/gis-ops/pyvalhalla
SummaryHigh-level bindings to the Valhalla C++ library
upload_time2023-05-16 11:48:25
maintainer
docs_urlNone
authorNils Nolde
requires_python>=3.7.0
license
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
# Valhalla for Python
[![Master Push](https://github.com/gis-ops/pyvalhalla/actions/workflows/push_master.yml/badge.svg)](https://github.com/gis-ops/pyvalhalla/actions/workflows/push_master.yml)

This spin-off project simply offers packaged Python bindings to the fantastic [Valhalla project](https://github.com/valhalla/valhalla).

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](./docs/releasing.md) 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](https://badge.fury.io/py/pyvalhalla.svg)
 
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](./examples/actor_examples.ipynb).

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](https://github.com/gis-ops/docker-valhalla) for a painless experience, e.g. this will build the routing graph for Andorra in `./custom_files`:

```shell
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:

```python
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](./LICENSE).

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/gis-ops/pyvalhalla",
    "name": "pyvalhalla",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7.0",
    "maintainer_email": "",
    "keywords": "",
    "author": "Nils Nolde",
    "author_email": "nils@gis-ops.com",
    "download_url": "",
    "platform": null,
    "description": "\n# Valhalla for Python\n[![Master Push](https://github.com/gis-ops/pyvalhalla/actions/workflows/push_master.yml/badge.svg)](https://github.com/gis-ops/pyvalhalla/actions/workflows/push_master.yml)\n\nThis spin-off project simply offers packaged Python bindings to the fantastic [Valhalla project](https://github.com/valhalla/valhalla).\n\nOver 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](./docs/releasing.md) to learn more about the versioning of this project.\n\n**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.\n\n## Installation\n\n![pypi version](https://badge.fury.io/py/pyvalhalla.svg)\n \nWe 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.\n\n`pip install pyvalhalla`\n\n**Note**, to install from PyPI as a **Linux** user you must have `pip` version 20.3 or greater installed.\n\n## Usage\n\nFind a more extended notebook in `./examples`, e.g. how to [use the actor](./examples/actor_examples.ipynb).\n\nBefore 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](https://github.com/gis-ops/docker-valhalla) for a painless experience, e.g. this will build the routing graph for Andorra in `./custom_files`:\n\n```shell\ndocker 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\n```\n\nOnce you have created a graph locally, you can use it like this:\n\n```python\nfrom valhalla import Actor, get_config, get_help\n\n# generate configuration\nconfig = get_config(tile_extract='./custom_files/valhalla_tiles.tar', verbose=True)\n\n# print the help for specific config items (has the same structure as the output of get_config()\nprint(get_help()[\"service_limits\"][\"auto\"][\"max_distance\"])\n\n# instantiate Actor to load graph and call actions\nactor = Actor(config)\nroute = actor.route({\"locations\": [...]})\n```\n\n## License\n\n`pyvalhalla` is licensed with GPLv2, see [LICENSE](./LICENSE).\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "High-level bindings to the Valhalla C++ library",
    "version": "3.2.0",
    "project_urls": {
        "Homepage": "https://github.com/gis-ops/pyvalhalla"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "600fd62584e8e3943b05155efb9dcc508656f2f41e6daecb2d96cc214b57ff03",
                "md5": "92476c6c0d0780acde86e2af6bf3e541",
                "sha256": "e4f01846cde7cf68a3599e97e0fe9e8304d53c8a9932d80c1845828fed2391d2"
            },
            "downloads": -1,
            "filename": "pyvalhalla-3.2.0-cp310-cp310-macosx_10_15_x86_64.whl",
            "has_sig": false,
            "md5_digest": "92476c6c0d0780acde86e2af6bf3e541",
            "packagetype": "bdist_wheel",
            "python_version": "cp310",
            "requires_python": ">=3.7.0",
            "size": 3174167,
            "upload_time": "2023-05-16T11:48:25",
            "upload_time_iso_8601": "2023-05-16T11:48:25.890927Z",
            "url": "https://files.pythonhosted.org/packages/60/0f/d62584e8e3943b05155efb9dcc508656f2f41e6daecb2d96cc214b57ff03/pyvalhalla-3.2.0-cp310-cp310-macosx_10_15_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6fb27a36d3b16f3e4d5c498bf93ba73dc5d9d2e213ddfbffe04fda04324c0053",
                "md5": "86d2b304b5ffc6188a85a37d21e61e4a",
                "sha256": "236a830cab7a99e9d30d678596dbfc3ebb70f4683f96a4e67efffbfc3989374b"
            },
            "downloads": -1,
            "filename": "pyvalhalla-3.2.0-cp310-cp310-manylinux_2_28_x86_64.whl",
            "has_sig": false,
            "md5_digest": "86d2b304b5ffc6188a85a37d21e61e4a",
            "packagetype": "bdist_wheel",
            "python_version": "cp310",
            "requires_python": ">=3.7.0",
            "size": 7819969,
            "upload_time": "2023-05-16T11:48:28",
            "upload_time_iso_8601": "2023-05-16T11:48:28.793375Z",
            "url": "https://files.pythonhosted.org/packages/6f/b2/7a36d3b16f3e4d5c498bf93ba73dc5d9d2e213ddfbffe04fda04324c0053/pyvalhalla-3.2.0-cp310-cp310-manylinux_2_28_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "af9684db8b654fcc48229844bc04e08fa70d3b8dde6728926fbce63e03924a95",
                "md5": "f86631a02658b73eb2e2affac85b1513",
                "sha256": "ee2f2d922ac700e3f436026fe571b069248349df136922ed5bd798117562a933"
            },
            "downloads": -1,
            "filename": "pyvalhalla-3.2.0-cp310-cp310-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "f86631a02658b73eb2e2affac85b1513",
            "packagetype": "bdist_wheel",
            "python_version": "cp310",
            "requires_python": ">=3.7.0",
            "size": 2719681,
            "upload_time": "2023-05-16T11:48:31",
            "upload_time_iso_8601": "2023-05-16T11:48:31.473757Z",
            "url": "https://files.pythonhosted.org/packages/af/96/84db8b654fcc48229844bc04e08fa70d3b8dde6728926fbce63e03924a95/pyvalhalla-3.2.0-cp310-cp310-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6750ebd67d0d19bdf9445e07ad66f2e971b45151f6367823f6336d205b9496aa",
                "md5": "4ffd08694dc2ed51f9c6ae6a6195441f",
                "sha256": "2f10ece9c9a4dc67cbe967686d4125d39c03b8b1f0f0a06111a9ba69d3026a48"
            },
            "downloads": -1,
            "filename": "pyvalhalla-3.2.0-cp311-cp311-macosx_10_15_x86_64.whl",
            "has_sig": false,
            "md5_digest": "4ffd08694dc2ed51f9c6ae6a6195441f",
            "packagetype": "bdist_wheel",
            "python_version": "cp311",
            "requires_python": ">=3.7.0",
            "size": 3174169,
            "upload_time": "2023-05-16T11:48:34",
            "upload_time_iso_8601": "2023-05-16T11:48:34.261368Z",
            "url": "https://files.pythonhosted.org/packages/67/50/ebd67d0d19bdf9445e07ad66f2e971b45151f6367823f6336d205b9496aa/pyvalhalla-3.2.0-cp311-cp311-macosx_10_15_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0e9a0e5bfd515e62c669413052893014f09e615ce0d7339fe9c7450797f42659",
                "md5": "40789ade99edf7215766396040817fb4",
                "sha256": "38b2366d1e7a41927f332f9877889ed74b6f6b61195fa6e70b8477169bd677f4"
            },
            "downloads": -1,
            "filename": "pyvalhalla-3.2.0-cp311-cp311-manylinux_2_28_x86_64.whl",
            "has_sig": false,
            "md5_digest": "40789ade99edf7215766396040817fb4",
            "packagetype": "bdist_wheel",
            "python_version": "cp311",
            "requires_python": ">=3.7.0",
            "size": 7819971,
            "upload_time": "2023-05-16T11:48:37",
            "upload_time_iso_8601": "2023-05-16T11:48:37.511459Z",
            "url": "https://files.pythonhosted.org/packages/0e/9a/0e5bfd515e62c669413052893014f09e615ce0d7339fe9c7450797f42659/pyvalhalla-3.2.0-cp311-cp311-manylinux_2_28_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8ff48081e0e212a5279a348a4c71fa6798c5aa8f86622ecb07943c2f9ce824c6",
                "md5": "4e7ebf5897a2e28e970494530aafdae2",
                "sha256": "b018336a32efd9178ba76ae5df14ea7953231205c309e170e500487dba0ab096"
            },
            "downloads": -1,
            "filename": "pyvalhalla-3.2.0-cp311-cp311-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "4e7ebf5897a2e28e970494530aafdae2",
            "packagetype": "bdist_wheel",
            "python_version": "cp311",
            "requires_python": ">=3.7.0",
            "size": 2719517,
            "upload_time": "2023-05-16T11:48:40",
            "upload_time_iso_8601": "2023-05-16T11:48:40.765719Z",
            "url": "https://files.pythonhosted.org/packages/8f/f4/8081e0e212a5279a348a4c71fa6798c5aa8f86622ecb07943c2f9ce824c6/pyvalhalla-3.2.0-cp311-cp311-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "724440f5ebc0b69df853e73207af79f3cb5cb1f68b5a2b9d6520598857c198d7",
                "md5": "089c894757257ff06cb272a1df73fa3b",
                "sha256": "ba647d5955c0c1344908047644d01b2425a4b98f2b679e02dc1936c2599a7045"
            },
            "downloads": -1,
            "filename": "pyvalhalla-3.2.0-cp37-cp37m-macosx_10_15_x86_64.whl",
            "has_sig": false,
            "md5_digest": "089c894757257ff06cb272a1df73fa3b",
            "packagetype": "bdist_wheel",
            "python_version": "cp37",
            "requires_python": ">=3.7.0",
            "size": 3173007,
            "upload_time": "2023-05-16T11:48:42",
            "upload_time_iso_8601": "2023-05-16T11:48:42.997293Z",
            "url": "https://files.pythonhosted.org/packages/72/44/40f5ebc0b69df853e73207af79f3cb5cb1f68b5a2b9d6520598857c198d7/pyvalhalla-3.2.0-cp37-cp37m-macosx_10_15_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "fb0e8effe28aeff624a8521d7acf256f0090711ecff9140338b70641c1d7fcf4",
                "md5": "8f59938d1cfb4832da88a3aab9a715cb",
                "sha256": "3e16068503bc5cba7cf8737a692b3aaae75a71f0ce457bad53efb19450047553"
            },
            "downloads": -1,
            "filename": "pyvalhalla-3.2.0-cp37-cp37m-manylinux_2_28_x86_64.whl",
            "has_sig": false,
            "md5_digest": "8f59938d1cfb4832da88a3aab9a715cb",
            "packagetype": "bdist_wheel",
            "python_version": "cp37",
            "requires_python": ">=3.7.0",
            "size": 7821373,
            "upload_time": "2023-05-16T11:48:45",
            "upload_time_iso_8601": "2023-05-16T11:48:45.570374Z",
            "url": "https://files.pythonhosted.org/packages/fb/0e/8effe28aeff624a8521d7acf256f0090711ecff9140338b70641c1d7fcf4/pyvalhalla-3.2.0-cp37-cp37m-manylinux_2_28_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "976625269bbf43d79b3ea1919ce988322ad7e6d3dbc346849a9a5b844e5494a2",
                "md5": "d65200f39bb8b38b443dbc492ae8306b",
                "sha256": "8a644b7d7dc8abd8acc86c08a836c724517edf9199447f3bb37f80e91ccb278c"
            },
            "downloads": -1,
            "filename": "pyvalhalla-3.2.0-cp37-cp37m-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "d65200f39bb8b38b443dbc492ae8306b",
            "packagetype": "bdist_wheel",
            "python_version": "cp37",
            "requires_python": ">=3.7.0",
            "size": 2740900,
            "upload_time": "2023-05-16T11:48:48",
            "upload_time_iso_8601": "2023-05-16T11:48:48.652818Z",
            "url": "https://files.pythonhosted.org/packages/97/66/25269bbf43d79b3ea1919ce988322ad7e6d3dbc346849a9a5b844e5494a2/pyvalhalla-3.2.0-cp37-cp37m-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4d6a09d9f839a3889dcf2892ee2986e81592491c46a131bdcbcd853f8f52ff3b",
                "md5": "c6d446189d7ebf5bcf8a76dd73cbe24d",
                "sha256": "f37e194a045094309719bbe9464bcb55fe41977b6cbeffbebd33a02d4c204f4e"
            },
            "downloads": -1,
            "filename": "pyvalhalla-3.2.0-cp38-cp38-macosx_10_15_x86_64.whl",
            "has_sig": false,
            "md5_digest": "c6d446189d7ebf5bcf8a76dd73cbe24d",
            "packagetype": "bdist_wheel",
            "python_version": "cp38",
            "requires_python": ">=3.7.0",
            "size": 3174086,
            "upload_time": "2023-05-16T11:48:51",
            "upload_time_iso_8601": "2023-05-16T11:48:51.801494Z",
            "url": "https://files.pythonhosted.org/packages/4d/6a/09d9f839a3889dcf2892ee2986e81592491c46a131bdcbcd853f8f52ff3b/pyvalhalla-3.2.0-cp38-cp38-macosx_10_15_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a4aa81bfd012b0c251f23dd2c2d04372d4c4517fb117f7d78817d69de18842d5",
                "md5": "be280d1c775d7ddb2cde9d88537b2bac",
                "sha256": "f73d51087731b0b13b3fded0653bfe565fa38d441b50ee28337ad409f80b917a"
            },
            "downloads": -1,
            "filename": "pyvalhalla-3.2.0-cp38-cp38-manylinux_2_28_x86_64.whl",
            "has_sig": false,
            "md5_digest": "be280d1c775d7ddb2cde9d88537b2bac",
            "packagetype": "bdist_wheel",
            "python_version": "cp38",
            "requires_python": ">=3.7.0",
            "size": 7819729,
            "upload_time": "2023-05-16T11:48:54",
            "upload_time_iso_8601": "2023-05-16T11:48:54.735538Z",
            "url": "https://files.pythonhosted.org/packages/a4/aa/81bfd012b0c251f23dd2c2d04372d4c4517fb117f7d78817d69de18842d5/pyvalhalla-3.2.0-cp38-cp38-manylinux_2_28_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "52dbacf577c1a66519d57bc9ac83617fadd0a369ae02e088869e4bab4af87f62",
                "md5": "0821639f7c9c7eb5309d1dc6f9f2e183",
                "sha256": "c209d5b1e41520c49857a25dc430cadb505bf54741bf2e057c27c8525dda9e96"
            },
            "downloads": -1,
            "filename": "pyvalhalla-3.2.0-cp38-cp38-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "0821639f7c9c7eb5309d1dc6f9f2e183",
            "packagetype": "bdist_wheel",
            "python_version": "cp38",
            "requires_python": ">=3.7.0",
            "size": 2740495,
            "upload_time": "2023-05-16T11:48:56",
            "upload_time_iso_8601": "2023-05-16T11:48:56.913598Z",
            "url": "https://files.pythonhosted.org/packages/52/db/acf577c1a66519d57bc9ac83617fadd0a369ae02e088869e4bab4af87f62/pyvalhalla-3.2.0-cp38-cp38-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d2697e41bebd6e86d2a984795a5246a6c04e903915ef06a6de1ac2bafdce1b14",
                "md5": "f10be22e3d1049f6507de0fb47b3926e",
                "sha256": "85234b510b32e7cc5a6ef7fafab47c4b83082a8507b7304458b544208766081e"
            },
            "downloads": -1,
            "filename": "pyvalhalla-3.2.0-cp39-cp39-macosx_10_15_x86_64.whl",
            "has_sig": false,
            "md5_digest": "f10be22e3d1049f6507de0fb47b3926e",
            "packagetype": "bdist_wheel",
            "python_version": "cp39",
            "requires_python": ">=3.7.0",
            "size": 3174373,
            "upload_time": "2023-05-16T11:48:59",
            "upload_time_iso_8601": "2023-05-16T11:48:59.256997Z",
            "url": "https://files.pythonhosted.org/packages/d2/69/7e41bebd6e86d2a984795a5246a6c04e903915ef06a6de1ac2bafdce1b14/pyvalhalla-3.2.0-cp39-cp39-macosx_10_15_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0de004f5efbce803887aac175fbdf048b68488cdf7fb1f850ff6d7c64c290e4a",
                "md5": "0179baefa92e18cb728f217298689828",
                "sha256": "408da8af2d8c6396dda4cd68555afdc7e2ff8fbab02131ee31517028fa319673"
            },
            "downloads": -1,
            "filename": "pyvalhalla-3.2.0-cp39-cp39-manylinux_2_28_x86_64.whl",
            "has_sig": false,
            "md5_digest": "0179baefa92e18cb728f217298689828",
            "packagetype": "bdist_wheel",
            "python_version": "cp39",
            "requires_python": ">=3.7.0",
            "size": 7820205,
            "upload_time": "2023-05-16T11:49:02",
            "upload_time_iso_8601": "2023-05-16T11:49:02.159476Z",
            "url": "https://files.pythonhosted.org/packages/0d/e0/04f5efbce803887aac175fbdf048b68488cdf7fb1f850ff6d7c64c290e4a/pyvalhalla-3.2.0-cp39-cp39-manylinux_2_28_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "153d366298ac7aecbb566e9d346530dfec58ca5b652e7c230e6a4c12cb9ac1b5",
                "md5": "8e0873eae117164da0ea24109c2a9df5",
                "sha256": "cb7d9da29f38a2da797069006e27b91c7ea84cba58b1c5e571a12d27893fcb20"
            },
            "downloads": -1,
            "filename": "pyvalhalla-3.2.0-cp39-cp39-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "8e0873eae117164da0ea24109c2a9df5",
            "packagetype": "bdist_wheel",
            "python_version": "cp39",
            "requires_python": ">=3.7.0",
            "size": 2720283,
            "upload_time": "2023-05-16T11:49:04",
            "upload_time_iso_8601": "2023-05-16T11:49:04.901245Z",
            "url": "https://files.pythonhosted.org/packages/15/3d/366298ac7aecbb566e9d346530dfec58ca5b652e7c230e6a4c12cb9ac1b5/pyvalhalla-3.2.0-cp39-cp39-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-05-16 11:48:25",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "gis-ops",
    "github_project": "pyvalhalla",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "pyvalhalla"
}
        
Elapsed time: 0.08522s