Python fuzzy search libraries

Updated Nov 2026

Python fuzzy search libraries find strings that nearly match a query despite typos, reordered words, or different spellings. A scorer computes an edit distance or similarity ratio between two strings and ranks candidates by that score. These libraries let apps and AI agents match names and records that differ by a few characters.

Popularity

RapidFuzz has the most monthly downloads among the dedicated fuzzy matching libraries in this comparison, at 143.8M.

LibraryMonthly downloadsStarsLast releaseLicense
regex
391.9M
Not on GitHubNov 2026Apache-2.0 AND CNRI-Python
RapidFuzz
143.8M
4.2KAug 2026MIT
Levenshtein
20.5M
Not on GitHubSep 2026GPL-2.0-or-later
jellyfish
11.1M
2.2KOct 2026MIT
TheFuzz
9.9M
3.6KJan 2024MIT
Polyleven
5.4M
Not on GitHubOct 2026MIT
pyspellchecker
3.5M
Not on GitHubOct 2026MIT
editdistance
2.7M
Not on GitHubFeb 2024MIT
Downloads: PyPI, last thirty days. Stars and releases: GitHub. Amber: no release in over a year.

Features compared

LibraryRanks arbitrary choicesFuzzy substring offsetsPhonetic encodings
regexUnsupportedBuilt-inUnsupported
RapidFuzzBuilt-inBuilt-inUnsupported
LevenshteinUnsupportedUnsupportedUnsupported
jellyfishUnsupportedUnsupportedBuilt-in
TheFuzzBuilt-inUnsupportedUnsupported
PolylevenUnsupportedUnsupportedUnsupported
pyspellcheckerUnsupportedUnsupportedUnsupported
editdistanceUnsupportedUnsupportedUnsupported
Built-inNot supported

Libraries and code examples

Matches regular expressions approximately, with limits on insertions, deletions, and substitutions.

Downloads / mo
391.9M
Last release
2026.11.19
License
Apache-2.0 AND CNRI-Python

Quickstart

From README.rst
$ python3.13 -m pip install regex==2026.11.19
import regex

regex.fullmatch(r"(?:cats|cat){e<=1}", "cat").fuzzy_counts

regex examples

From open-source projects on GitHub

Provides string similarity metrics and candidate matching APIs.

Downloads / mo
143.8M
Stars
4.2K
Last release
3.14.6
License
MIT

Strengths

  • Ranks matching choices. Use process.extract or extractOne to search a collection of candidates.
  • Handles reordered word tokens. Use token_sort_ratio when word order should not determine the match.

Limitations

  • Preprocessing is opt-in. Supply a processor when case and punctuation should be normalized.
  • Token sets ignore extra words. Token-set scoring can treat a token subset as a complete match.

Quickstart

From README.md
$ python3.13 -m pip install rapidfuzz==3.14.6
from rapidfuzz import fuzz

fuzz.ratio("this is a test", "this is a test!")

RapidFuzz examples

From open-source projects on GitHub

Computes edit distances, similarity ratios, and edit operations between strings.

Downloads / mo
20.5M
Last release
0.27.5
License
GPL-2.0-or-later

Quickstart

From levenshtein.html
$ python3.13 -m pip install Levenshtein==0.27.5
from Levenshtein import distance

distance("lewenstein", "levenshtein")

Levenshtein examples

From open-source projects on GitHub

Provides approximate string comparison and phonetic encoding functions.

Downloads / mo
11.1M
Stars
2.2K
Last release
1.3.0
License
MIT

Strengths

  • Compares spelling and pronunciation. Choose string-comparison functions or phonetic encoders for the matching task.
  • Compares sets of words. Jaccard similarity can compare words or configured character sequences.

Limitations

  • NYSIIS targets English names. Choose another approach when the relevant pronunciation follows another language.

Quickstart

From README.md
$ python3.13 -m pip install jellyfish==1.3.0
import jellyfish

jellyfish.levenshtein_distance("jellyfish", "smellyfish")

jellyfish examples

From open-source projects on GitHub

Provides fuzzy string scoring and matching against candidate collections.

Downloads / mo
9.9M
Stars
3.6K
Last release
0.22.1
License
MIT

Strengths

  • Ranks choices with custom scorers. Pass a scorer to extractOne to change how candidates are matched.
  • Handles reordered word tokens. Use token_sort_ratio when comparing text with reordered words.

Limitations

  • Rounds similarity scores. Standard scorer results are rounded to integers.
  • Deduplication favors longer text. dedupe retains the longest matching string, with alphabetical tie-breaking.

Quickstart

From README.rst
$ python3.13 -m pip install thefuzz==0.22.1
from thefuzz import fuzz

fuzz.ratio("this is a test", "this is a test!")

TheFuzz examples

From open-source projects on GitHub

Computes Levenshtein distance between Unicode strings with an optional maximum distance.

Downloads / mo
5.4M
Last release
0.12.0
License
MIT

Quickstart

From README.rst
$ python3.13 -m pip install polyleven==0.12.0
from polyleven import levenshtein

levenshtein("aaa", "ccc")

Polyleven examples

From open-source projects on GitHub

Corrects spelling from word-frequency dictionaries with a configurable edit distance.

Downloads / mo
3.5M
Last release
0.9.1
License
MIT

Quickstart

From quickstart.rst
$ python3.13 -m pip install pyspellchecker==0.9.1
from spellchecker import SpellChecker

spell = SpellChecker()
spell.known(["morning", "hapenning"])

pyspellchecker examples

From open-source projects on GitHub

Computes Levenshtein distance on strings or sequences of hashable items in C++.

Downloads / mo
2.7M
Last release
0.8.1
License
MIT

Quickstart

From README.md
$ python3.13 -m pip install editdistance==0.8.1
import editdistance
editdistance.eval('banana', 'bahama')

editdistance examples

From open-source projects on GitHub

FAQ

RapidFuzz suits most fuzzy matching, with string scorers and ranked extraction from a list of candidates. jellyfish suits phonetic matching such as Soundex and Metaphone. regex suits approximate matching inside a regular expression.

RapidFuzz provides string similarity metrics and ranks a list of candidates against a query. A separate alignment API returns where the match falls in each string.

TheFuzz carries FuzzyWuzzy-style string, token, and partial scores under a new package name. It is implemented on RapidFuzz.

Levenshtein computes edit distance, normalized ratios, and edit operations between two strings. editdistance and Polyleven compute the distance alone, and Polyleven accepts a maximum distance.

For coding agents

Found your fuzzy search library? Help your agent use it.

Connect Exa so your coding agent can find the library’s documentation, check its API, and look up implementations while you build.

Run in your terminal

claude plugin install exa@claude-plugins-official