fuzzyfinder

raw JSON →
2.3.0 verified Fri May 01 auth: no python

A lightweight Python library for fuzzy string matching and autocompletion. It uses fuzzy search algorithms to find approximate matches based on Levenshtein distance. Current version 2.3.0, released 2025-03-07. Maintained, with low release cadence.

pip install fuzzyfinder
error ModuleNotFoundError: No module named 'fuzzyfinder'
cause The library is not installed or not in the current environment.
fix
Run: pip install fuzzyfinder
error AttributeError: module 'fuzzyfinder' has no attribute 'fuzzyfinder'
cause The import statement is incorrect (e.g., import fuzzyfinder then calling fuzzyfinder.fuzzyfinder).
fix
Use correct import: from fuzzyfinder import fuzzyfinder
deprecated The `accessor` argument is deprecated and will be removed in future versions.
fix Avoid using `accessor`; pass a list of strings directly.
breaking In version 2.0.0, the library dropped support for Python 2 and Python <3.10.
fix Use Python >=3.10.
gotcha The function returns an empty list if no matches are found, not `None`.
fix Check for empty list rather than None: if not results: ...

Basic usage: fuzzyfinder(search_term, list_of_strings) returns list of matches.

from fuzzyfinder import fuzzyfinder

# Sample list of strings
strings = ['apple', 'banana', 'grape', 'pineapple', 'orange']
# Fuzzy search for 'app' with default threshold
results = fuzzyfinder('app', strings)
print(results)  # Output: ['apple', 'pineapple']