Repository navigation
Rapidfuzz #6717
|
PyPI link: https://pypi.org/project/rapidfuzz/ RapidFuzz is a fast fuzzy string matching library using Levenshtein Distance and other string metrics. It's a drop-in replacement for fuzzywuzzy but MIT-licensed and orders of magnitude faster thanks to its C++ backend. Useful for search, autocomplete, deduplication, and data cleaning in Flet apps — especially important on mobile where CPU is limited and the speed difference vs pure-Python alternatives matters. |
Replies: 1 comment
|
rapidfuzz 3.14.5 is now supported on Android and iOS: https://pypi.flet.dev/rapidfuzz/ RapidFuzz is fast fuzzy string matching for Flet apps — search, autocomplete, dedupe, and fuzzy lookups, all computed on-device by its C++ core. It's a drop-in, much faster replacement for fuzzywuzzy, and MIT-licensed. InstallOnce published, just add it to your app's dependencies = [
"flet",
"rapidfuzz",
]No extra dependencies — the base install is self-contained. ( Minimal example — a live fuzzy search that shows ranked matches with scores: import flet as ft
from rapidfuzz import process, fuzz
FRUITS = ["apple", "banana", "orange", "pineapple", "grapefruit",
"strawberry", "blueberry", "watermelon", "mango", "peach"]
def main(page: ft.Page):
page.title = "RapidFuzz demo"
results = ft.ListView(expand=True, spacing=6)
def search(e):
query = e.control.value.strip()
results.controls.clear()
if query:
# top-5 fuzzy matches, scored by the C++ backend
for name, score, _ in process.extract(query, FRUITS,
scorer=fuzz.WRatio, limit=5):
results.controls.append(ft.Text(f"{name} — {score:.0f}%", size=18))
page.update()
page.add(
ft.TextField(label="Type a fuzzy fruit name", autofocus=True, on_change=search),
ft.Divider(),
results,
)
ft.run(main)Type What you get
Threading — interactive search over a modest list (as above) is fine on the UI thread. For heavy batch work — deduping thousands of records, or a large Performance note — on mobile you get the scalar C++ path (the x86 SSE2/AVX2 kernels are x86-only and aren't part of the ARM build). That's still dramatically faster than any pure-Python fuzzy matcher — the compiled extension is active, not the fallback. Prefer Offline — fully offline; no network, no data files, no storage wiring needed. |
rapidfuzz 3.14.5 is now supported on Android and iOS: https://pypi.flet.dev/rapidfuzz/
RapidFuzz is fast fuzzy string matching for Flet apps — search, autocomplete, dedupe, and fuzzy lookups, all computed on-device by its C++ core. It's a drop-in, much faster replacement for fuzzywuzzy, and MIT-licensed.
Install
Once published, just add it to your app's
pyproject.toml:No extra dependencies — the base install is self-contained. (
numpyis optional, pulled only via therapidfuzz[all]extra for array-batch ops; you don't need it for normal use.) Works on all Android ABIs (arm64-v8a, x86_64, armeabi-v7a) and iOS.Minimal example — a live fuzzy searc…