--- id: fuzzysearch version: "0.8.1" license: MIT license_treatment: permissive maintenance: aging --- # fuzzysearch — fuzzysearch is useful for finding approximate subsequence matches License: permissive · Maintenance: aging · Downloads: 770.3K/mo ## 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 above — 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 pip install fuzzysearch uv add fuzzysearch 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: unspecified - Install friction: medium - Maintenance: aging - Downloads: 770.3K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags fuzzy substring search, approximate pattern matching, levenshtein distance search, typo-tolerant text search, near-match sequence finder, fuzzy sequence matching, DNA sequence search, approximate-matching, sequence-search, bioinformatics [View on SkillFed](https://skillfed.io/packages/fuzzysearch) · [View on PyPI](https://pypi.org/project/fuzzysearch/)