RapidFuzz: Rapid fuzzy string matching in Python
RapidFuzz is a high-performance Python library for rapid fuzzy string matching, utilizing various string metrics. The current version is 3.14.3, released on March 28, 2026. It is actively maintained with regular updates to improve performance and functionality.
Warnings
- breaking Starting from version 3.0.0, RapidFuzz no longer preprocesses strings by default (e.g., removing non-alphanumeric characters, trimming whitespaces, converting to lowercase). This change may affect similarity scores when comparing strings with different cases or punctuation. To enable preprocessing, use the 'processor' parameter with 'utils.default_process'.
- gotcha Ensure that the 'numpy' package is installed, as RapidFuzz relies on it for efficient numerical computations. If 'numpy' is not installed, you may encounter import errors or performance issues.
Install
-
pip install rapidfuzz
Imports
- fuzz
from rapidfuzz import fuzz
Quickstart
from rapidfuzz import fuzz
# Compare two strings
string1 = 'hello world'
string2 = 'helo world'
# Calculate similarity ratio
similarity = fuzz.ratio(string1, string2)
print(f'Similarity: {similarity}%')