Skip to content

fastquadtree

Rust-optimized quadtree with a clean Python API

PyPI Python versions Downloads Build Coverage

PyO3 maturin

Interactive Screenshot

Why use fastquadtree

  • Clean Python API with no external dependencies and modern typing hints
  • The fastest quadtree Python package (>10x faster than pyqtree)
  • Prebuilt wheels for Windows, macOS, and Linux
  • Support for inserting bounding boxes or points
  • Fast KNN and range queries
  • Optional object tracking for id ↔ object mapping
  • Fast serialization to/from bytes
  • Support for multiple data types (f32, f64, i32, i64) for coordinates
  • 100% test coverage and CI on GitHub Actions

Examples

See examples of how fastquadtree can be used in the runnables section.

Install

pip install fastquadtree

Import

from fastquadtree import QuadTree  # Point handling
from fastquadtree import RectQuadTree  # Bounding box handling
from fastquadtree.pyqtree import Index # Drop-in replacement for pyqtree (6.567x faster while keeping the same API)