Registry / ai-ml / rapidfuzz

rapidfuzz

JSON →
library3.14.5pypypi✓ verified 27d ago

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.

pip install rapidfuzz
INSTALL
IMPORT
SIG · RAPIDFUZZ
R
rapidfuzz
ai-mlpythonv3.14.5
Install
2.6s avg
Import
35ms
Disk
30MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v3.14.5 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.036s · 33.6MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 2.6s · import 0.034s · 30MB
30MB installed
● package 30MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

fuzz
from rapidfuzz import fuzz
Direct import from the 'fuzz' module

A simple example demonstrating how to use RapidFuzz to compare two strings and calculate their similarity ratio.

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}%')
Debug
Known issues
breakingStarting 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'.
fix
Use the 'processor' parameter with 'utils.default_process' to enable preprocessing.
affects: >=3.0.0
gotchaEnsure 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.
fix
Install 'numpy' using 'pip install numpy'.
affects: All versions
Errors
Common errors & fixes
error: Microsoft Visual C++ 14.0 or greater is required
RapidFuzz is a C++ extension that requires a compatible C++ compiler (like MSVC on Windows) to be installed on your system for pip to compile it during installation.
fix
Install the 'Build Tools for Visual Studio' (for Windows) and ensure the 'Desktop development with C++' workload is selected. On Linux/macOS, ensure development tools like `build-essential` (Debian/Ubuntu) or `Xcode Command Line Tools` (macOS) are installed.
ModuleNotFoundError: No module named 'rapidfuzz'
The rapidfuzz library has not been installed in your current Python environment, or the environment where it's installed is not active.
fix
Install the library using pip: `pip install rapidfuzz`
AttributeError: module 'rapidfuzz' has no attribute 'ratio'
The `ratio` function (and other fuzzy string metrics) are located within the `rapidfuzz.fuzz` submodule, not directly under the top-level `rapidfuzz` module.
fix
Import `ratio` from `rapidfuzz.fuzz` or import `fuzz` and access it as `fuzz.ratio`:
```python
from rapidfuzz.fuzz import ratio
ratio("apple", "appel")
# OR
from rapidfuzz import fuzz
fuzz.ratio("apple", "appel")
```
AttributeError: module 'rapidfuzz.fuzz' has no attribute 'extract'
The `extract` function, used for extracting best matches from a list of choices, is located in the `rapidfuzz.process` submodule, not `rapidfuzz.fuzz`.
fix
Import `extract` from `rapidfuzz.process`:
```python
from rapidfuzz import process
process.extract("apple", ["orange", "apple pie", "banana"])
```
Upgrade
Version history
3.14.5latest on PyPI · released Apr 7, 2026
Audit
Dependencies
numpyrequiredRequired for efficient numerical computations
Agent activity
13 hits · last 30 days
node
10
OpenAI (training)
2
Resources