skillfed

fuzzysearch

fuzzysearch is useful for finding approximate subsequence matches

fuzzysearch v0.8.1 770.3K downloads/30d#5,105 on PyPI342
Permissive license MIT AGING released

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 fuzzysearch

uv

uv add fuzzysearch

poetry

poetry add fuzzysearch

Installing 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

Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseNatural Language :: EnglishProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: Software Development :: Libraries :: Python Modules

Tags

fuzzy substring searchapproximate pattern matchinglevenshtein distance searchtypo-tolerant text searchnear-match sequence finderfuzzy sequence matchingDNA sequence search
approximate-matchingsequence-searchbioinformatics

More Python Modules packages