Skip to main content

pyroutingkit

Python bindings for RoutingKit Customizable Contraction Hierarchies (CCH).

Provides microsecond-scale shortest-path queries on large road networks (millions of nodes). Pre-compiled wheels for Linux (manylinux) and macOS — no C++ toolchain needed at install time.

Install

pip install pyroutingkit

Usage

import numpy as np
from pyroutingkit import CCH, INF_WEIGHT

# Build topology (one-time, expensive — can be saved/loaded)
cch = CCH()
tail = np.array([0, 1, 2], dtype=np.uint32)
head = np.array([1, 2, 0], dtype=np.uint32)
lat = np.array([9.0, 9.5, 9.2], dtype=np.float32)
lon = np.array([38.7, 39.0, 38.5], dtype=np.float32)
cch.build_topology(tail, head, lat, lon, node_count=3)

# Customize with weights (fast, can be called multiple times)
weights = np.array([100, 150, 120], dtype=np.uint32)
cch.customize_weights(weights)

# Query (microseconds)
distance, path = cch.query(0, 2)
print(f"Distance: {distance}, Path: {path}")

# Many-to-many matrix
sources = np.array([0, 1], dtype=np.uint32)
targets = np.array([1, 2], dtype=np.uint32)
matrix = cch.distances_many_to_many(sources, targets)

# Save/load topology (skip expensive build on next run)
cch.save_topology("/tmp/cch_cache")
cch2 = CCH()
cch2.load_topology("/tmp/cch_cache")
cch2.customize_weights(weights)  # Must re-customize after load

API

CCH class

Method Description
build_topology(tail, head, lat, lon, node_count) Build CCH from graph arrays. Uses inertial flow for node ordering.
customize_weights(weights) Set edge weights (uint32). Can be called multiple times.
query(source, target) Point-to-point query. Returns (distance, path).
distances_many_to_many(sources, targets) NxM distance matrix.
save_topology(dir_path) Save topology to disk (binary format).
load_topology(dir_path) Load topology from disk (skips build).

Properties

Property Type Description
node_count int Number of nodes
arc_count int Number of directed edges
is_built bool Topology has been built or loaded
is_customized bool Weights have been set

Constants

Constant Description
INF_WEIGHT Sentinel value for unreachable pairs

Building from source

Requires CMake 3.20+ and a C++17 compiler.

git clone --recurse-submodules https://github.com/nullbutt/pyroutingkit
cd pyroutingkit
uv build

License

MIT. RoutingKit is also MIT-licensed.

Metadata

Release files for pyroutingkit 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyroutingkit 0.2.1
File Size Uploaded Provenance Actions
pyroutingkit-0.2.1.tar.gz 174.1 kB With provenance Details for pyroutingkit-0.2.1.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for pyroutingkit 0.2.1
File Actions
pyroutingkit-0.2.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.17+ x86-64 Details for pyroutingkit-0.2.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
pyroutingkit-0.2.1-cp313-cp313-macosx_11_0_arm64.whl CPython 3.13 CPython 3.13 macOS 11.0+ ARM64 Details for pyroutingkit-0.2.1-cp313-cp313-macosx_11_0_arm64.whl
pyroutingkit-0.2.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.17+ x86-64 Details for pyroutingkit-0.2.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
pyroutingkit-0.2.1-cp312-cp312-macosx_11_0_arm64.whl CPython 3.12 CPython 3.12 macOS 11.0+ ARM64 Details for pyroutingkit-0.2.1-cp312-cp312-macosx_11_0_arm64.whl
pyroutingkit-0.2.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.17+ x86-64 Details for pyroutingkit-0.2.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
pyroutingkit-0.2.1-cp311-cp311-macosx_11_0_arm64.whl CPython 3.11 CPython 3.11 macOS 11.0+ ARM64 Details for pyroutingkit-0.2.1-cp311-cp311-macosx_11_0_arm64.whl
pyroutingkit-0.2.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.17+ x86-64 Details for pyroutingkit-0.2.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
pyroutingkit-0.2.1-cp310-cp310-macosx_11_0_arm64.whl CPython 3.10 CPython 3.10 macOS 11.0+ ARM64 Details for pyroutingkit-0.2.1-cp310-cp310-macosx_11_0_arm64.whl

Total release size: 2.4 MB

Release files / pyroutingkit-0.2.1.tar.gz

Download URL pyroutingkit-0.2.1.tar.gz
Size 174.1 kB
Tags Source
SHA-256 checksum
How to use checksums
144fa582c824ea94075abc1fce5d2b2cecadfd87d83cf1b39b3ad28138ef79e4
BLAKE2b-256 checksum
How to use checksums
e6156f27b9aa2b2f2ed9d3f40c71435a650375b40827d15cb3c67ad5777d1f34
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 10, 2026.

Transparency log

Release files / pyroutingkit-0.2.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL pyroutingkit-0.2.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 355.8 kB
Tags CPython 3.13 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
4321d24392055a9263e2fc3df520398e0fa9b928fb31e63715c3089c81650939
BLAKE2b-256 checksum
How to use checksums
c4888144e55fff4db9c5b934feb066a0c644fa34a098dd0994590422ebba86e0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 10, 2026.

Transparency log

Release files / pyroutingkit-0.2.1-cp313-cp313-macosx_11_0_arm64.whl

Download URL pyroutingkit-0.2.1-cp313-cp313-macosx_11_0_arm64.whl
Size 213.2 kB
Tags CPython 3.13 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
0d083842f4b1b32b518360c801642967e9344bd30b86807fca6223740ba588cc
BLAKE2b-256 checksum
How to use checksums
bdcd9da728ac6baaadbae32fd59e8d6918fc617859e9df0f10e35e7ddabc3139
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 10, 2026.

Transparency log

Release files / pyroutingkit-0.2.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL pyroutingkit-0.2.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 355.8 kB
Tags CPython 3.12 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
4bc81f3e0772c0fbd17db77734b96d70028b7acbb18c773b8b9b92985f69dab4
BLAKE2b-256 checksum
How to use checksums
12e7f0db494ebab530b1b417e3f3c0f811e6e61026fddf35296cf18abb3723dc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 10, 2026.

Transparency log

Release files / pyroutingkit-0.2.1-cp312-cp312-macosx_11_0_arm64.whl

Download URL pyroutingkit-0.2.1-cp312-cp312-macosx_11_0_arm64.whl
Size 213.1 kB
Tags CPython 3.12 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
203ce70baacc869f9e7eb3e7f5e69e50992473488d5c9d566704b0f85d97fb57
BLAKE2b-256 checksum
How to use checksums
0c4de1203e87d247fee874b432610a2f1525834ca53aff40b505cc488b72ac4b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 10, 2026.

Transparency log

Release files / pyroutingkit-0.2.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL pyroutingkit-0.2.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 355.4 kB
Tags CPython 3.11 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
26a2f3f8ab1af06b0976cd3f4ddb0fa48e00ffb5094ab74ba7e65ec7b661a3fb
BLAKE2b-256 checksum
How to use checksums
3b23387fa4975405fff63721c1773384f6cc23f169849b1af4284be01cf0b51e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 10, 2026.

Transparency log

Release files / pyroutingkit-0.2.1-cp311-cp311-macosx_11_0_arm64.whl

Download URL pyroutingkit-0.2.1-cp311-cp311-macosx_11_0_arm64.whl
Size 211.3 kB
Tags CPython 3.11 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
e5af766b2cb6b777a6202f46965d8bfd9af4f7c058f0fac56c57df511f553f63
BLAKE2b-256 checksum
How to use checksums
68c1ecf85f640e758b324d613b500994804bce17751fb2be227bc0b06b7b6a51
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 10, 2026.

Transparency log

Release files / pyroutingkit-0.2.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL pyroutingkit-0.2.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 354.5 kB
Tags CPython 3.10 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
88fd8445d431681bb59205a8acf847cf0723662a994fe082b8172a1f6082e79a
BLAKE2b-256 checksum
How to use checksums
abde5bbf4f297b8bac2c759660f3a3f7600fe159bac293b89ca8e4c4ba702c65
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 10, 2026.

Transparency log

Release files / pyroutingkit-0.2.1-cp310-cp310-macosx_11_0_arm64.whl

Download URL pyroutingkit-0.2.1-cp310-cp310-macosx_11_0_arm64.whl
Size 210.2 kB
Tags CPython 3.10 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
6cc783c7e9c155c7380a30555096c4c684e82c1082b2c1454fec1a709b87269a
BLAKE2b-256 checksum
How to use checksums
e1166b0d77142022e173c4f41d825793ac8758dbcb250c13e4b7943b0f3d96c1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 10, 2026.

Transparency log

Security for pyroutingkit 0.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 9 files in this release have been uploaded with provenance metadata.

Select from 9 files

Attestation for pyroutingkit-0.2.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 10, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page