fuzzysearch
fuzzysearch is useful for finding approximate subsequence matches
What it is and what it does
fuzzysearch is a specialized library for finding approximate substring matches within longer text or binary data, allowing for a configurable number of character insertions, deletions, substitutions, or a maximum Levenshtein distance. Unlike string-comparison libraries that measure overall similarity between two strings, fuzzysearch searches through a haystack for fuzzy matches to a needle pattern, making it suited for ad-hoc searching rather than indexed full-text retrieval.
The package provides two main functions: `find_near_matches()` for in-memory data and `find_near_matches_in_file()` for file-based searches. It automatically selects the fastest algorithm based on your matching parameters, includes optional C and Cython optimizations for performance, and falls back to pure-Python implementations if compilation fails. It has a single runtime dependency (attrs) and supports Python 3.8+ as well as PyPy.
Use it for:
- Search for DNA or protein sequences with tolerance for mutations or sequencing errors in genomic data.
- Find typo-tolerant pattern matches in log files or large text corpora without building an index.
- Locate approximate keyword matches in user input or search queries with character-level flexibility.
- Detect near-duplicate or slightly corrupted records in data processing pipelines.
- Search binary data for patterns with known bit-level variations or corruption.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Finds approximate substring matches in text or data with configurable Levenshtein distance tolerance, automatically selecting the fastest algorithm for the search parameters.
Yes, if you need to search for approximate substring matches in long text or binary data. The library is well-maintained, has no known vulnerabilities, and its single dependency and pure-Python fallback make installation reliable. It is not suitable if you need full-text indexing or string-pair similarity comparison—use it for ad-hoc fuzzy substring search only.
Install
fuzzysearch on PyPI
pip
pip install fuzzysearchuv
uv add fuzzysearchpoetry
poetry add fuzzysearchInstalling fuzzysearch
Before you install
Medium install friction due to optional C and Cython extensions, but pure-Python fallbacks ensure installation always succeeds. Last release was 276 days ago; repository is active and not archived, though maintenance status is aging.
License in practice
MIT license is permissive, allowing commercial and private use with minimal restrictions—suitable for most projects.
Quickstart
pip install fuzzysearch
from fuzzysearch import find_near_matches
result = find_near_matches('PATTERN', '---PATERN---', max_l_dist=1)
print(result) # [Match(start=3, end=9, dist=1, matched="PATERN")]
Verify before relying
- Performance characteristics and speed improvements from C/Cython extensions versus pure-Python fallback are not quantified in the fact sheet.
- Whether the package handles very large files or sequences efficiently is not documented in the excerpt.
Package facts
| License | MIT (permissive) |
| Python support | not specified |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | 1 — attrs |
| Maintenance | aging — 276 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 770,270/month — #5,105 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: fuzzysearch-0.8.1-cp310-cp310-macosx_10_9_x86_64.whl; fuzzysearch-0.8.1-cp310-cp310-macosx_11_0_arm64.whl; fuzzysearch-0.8.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl; fuzzysearch-0.8.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl; fuzzysearch-0.8.1-cp310-cp310-musllinux_1_2_i686.whl; fuzzysearch-0.8.1-cp310-cp310-musllinux_1_2_x86_64.whl; fuzzysearch-0.8.1-cp310-cp310-win32.whl; fuzzysearch-0.8.1-cp310-cp310-win_amd64.whl; fuzzysearch-0.8.1-cp311-cp311-macosx_10_9_x86_64.whl; fuzzysearch-0.8.1-cp311-cp311-macosx_11_0_arm64.whl; fuzzysearch-0.8.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl; fuzzysearch-0.8.1-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl; fuzzysearch-0.8.1-cp311-cp311-musllinux_1_2_i686.whl; fuzzysearch-0.8.1-cp311-cp311-musllinux_1_2_x86_64.whl; fuzzysearch-0.8.1-cp311-cp311-win32.whl; fuzzysearch-0.8.1-cp311-cp311-win_amd64.whl; fuzzysearch-0.8.1-cp312-cp312-macosx_10_9_x86_64.whl; fuzzysearch-0.8.1-cp312-cp312-macosx_11_0_arm64.whl; fuzzysearch-0.8.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl; fuzzysearch-0.8.1-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Keywords: fuzzysearch
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
fuzzyset2Performs fuzzy string matching and approximate…
permissive · top 15,000 on PyPI
thefuzzTheFuzz performs fuzzy string matching using…
permissive · top 5,000 on PyPI
ngramExtends Python's set class to perform fuzzy…
copyleft · top 15,000 on PyPI
strsimpyImplements a dozen string similarity and…
permissive · top 15,000 on PyPI
fuzzywuzzyFuzzyWuzzy performs fuzzy string matching using…
copyleft · top 5,000 on PyPI
textdistanceComputes distance and similarity between text…
permissive · top 5,000 on PyPI
python-LevenshteinComputes Levenshtein edit distance, string…
copyleft · top 5,000 on PyPI
fuzzyfinderFuzzy finder that matches partial strings from…
permissive · top 15,000 on PyPI
RapidFuzzRapidFuzz provides fast fuzzy string matching…
permissive · top 1,000 on PyPI
tfidf-matcherPerforms fast fuzzy string matching on large…
permissive · top 15,000 on PyPI