Rapid fuzzy string matching in Python and C++ using the Levenshtein Distance
RapidFuzz is a fast string matching library for Python and C++, which is using the string similarity calculations from FuzzyWuzzy. However there are two aspects that set RapidFuzz apart from FuzzyWuzzy:
It is MIT licensed so it can be used whichever License you might want to choose for your project, while you're forced to adopt the GPLv2 license when using FuzzyWuzzy
It is mostly written in C++ and on top of this comes with a lot of Algorithmic improvements to make string matching even faster, while still providing the same results. These changes result in a 2-100x Speedup in String Matching. More details on benchmark results can be found here
$ pip install rapidfuzz > from rapidfuzz import fuzz > from rapidfuzz import process > fuzz.ratio("this is a test", "this is a test!") 96.55171966552734 > fuzz.partial_ratio("this is a test", "this is a test!") 100.0 > fuzz.ratio("fuzzy wuzzy was a bear", "wuzzy fuzzy was a bear") 90.90908813476562 > fuzz.token_sort_ratio("fuzzy wuzzy was a bear", "wuzzy fuzzy was a bear") 100.0 > fuzz.token_sort_ratio("fuzzy was a bear", "fuzzy fuzzy was a bear") 83.8709716796875 > fuzz.token_set_ratio("fuzzy was a bear", "fuzzy fuzzy was a bear") 100.0 > choices = ["Atlanta Falcons", "New York Jets", "New York Giants", "Dallas Cowboys"] > process.extract("new york jets", choices, limit=2) [('new york jets', 100), ('new york giants', 78.57142639160156)] > process.extractOne("cowboys", choices) ("dallas cowboys", 90)