pybktree is a Python implementation of BK-trees (Burkhard-Keller trees), an efficient data structure for performing nearest-neighbor search in metric spaces. It supports fast querying of items within a specified edit distance, commonly used for fuzzy string matching. The current version is 1.1, with no recent activity since 2015.
pip install pybktreeNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Create a BKTree with a distance function and items. Query with a target and maximum distance.
Ensure your distance function is a proper metric (e.g., Levenshtein, Hamming, Euclidean).
Consider using a more modern library like `textdistance` or `rapidfuzz` for fuzzy matching.
Run: pip install pybktree
Pass a callable distance function, e.g., BKTree(lambda a,b: abs(a-b), items)
No dependency data recorded yet.