Fuzzywuzzy: Python Library for Fuzzy String Matching
This repository profile is provided by osrepos.com, an open source repository discovery platform.

Summary
Fuzzywuzzy is a popular Python library designed for fuzzy string matching, enabling efficient comparison and similarity scoring between text strings. It leverages Levenshtein distance to help with tasks like data cleaning and record linkage. While widely used, this project has been superseded by TheFuzz, which continues its development under a new name.
Repository Information
Topics
Click on any tag to explore related repositories
Use at your own risk
OSRepos shares public repositories for knowledge and discovery only. Any installation, execution, configuration, or use of code from these repositories is the user's own responsibility. Always review the repository, source code, dependencies, licenses, and security implications before running or installing anything. OSRepos is not responsible for issues, damages, or losses resulting from third-party repositories.
Introduction
Fuzzywuzzy is a powerful Python library for fuzzy string matching, based on Levenshtein distance. It provides a simple API to compare strings and determine their similarity, making it invaluable for tasks requiring flexible text comparison. Important Note: This project has been renamed and moved to TheFuzz, which is the actively maintained successor. Users are encouraged to migrate to TheFuzz for ongoing development and support.
Installation
To install Fuzzywuzzy, you can use pip. However, it is highly recommended to install thefuzz instead, as fuzzywuzzy is no longer actively maintained and thefuzz offers the same functionality with continued support.
pip install fuzzywuzzy[speedup]
# Recommended: Install thefuzz instead
# pip install thefuzz[speedup]
The [speedup] option installs python-Levenshtein, which significantly improves performance for string comparisons.
Examples
Fuzzywuzzy offers various methods for comparing strings, including simple ratio, partial ratio, token sort ratio, and token set ratio.
from fuzzywuzzy import fuzz
from fuzzywuzzy import process
# Simple Ratio
print(fuzz.ratio("this is a test", "this is a test!")) # Output: 97
# Partial Ratio
print(fuzz.partial_ratio("this is a test", "this is a test!")) # Output: 100
# Token Sort Ratio
print(fuzz.token_sort_ratio("fuzzy wuzzy was a bear", "wuzzy fuzzy was a bear")) # Output: 100
# Token Set Ratio
print(fuzz.token_set_ratio("fuzzy was a bear", "fuzzy fuzzy was a bear")) # Output: 100
# Extracting best matches from a list
choices = ["apple pie", "grape juice", "apple sauce", "orange juice"]
print(process.extract("apple", choices, limit=2)) # Output: [('apple pie', 90), ('apple sauce', 90)]
print(process.extractOne("apple", choices)) # Output: ('apple pie', 90)
Why Use Fuzzy String Matching?
Fuzzy string matching is crucial in many applications where exact string matches are not sufficient. It helps in:
- Data Cleaning: Identifying and merging duplicate records with slight variations or typos.
- Search Functionality: Providing more robust search results by matching queries even with minor spelling errors.
- Natural Language Processing (NLP): Comparing text for similarity in tasks like plagiarism detection or text deduplication.
- Record Linkage: Connecting records across different datasets that may have inconsistent naming conventions.
Fuzzywuzzy, and its successor TheFuzz, provide a straightforward and efficient way to implement these capabilities in Python.
Links
Related repositories
Similar repositories that may be relevant next.

fake2db: Generate Custom Test Databases with Fake Data
August 2, 2026
fake2db is a powerful Python utility designed to create custom test databases populated with fake, yet valid, data. It supports a wide array of popular database systems, including SQLite, MySQL, PostgreSQL, MongoDB, Redis, and CouchDB. This tool is ideal for developers and testers needing quick, realistic data for testing and development environments.

Mimesis: A Powerful Python Library for Realistic Fake Data Generation
August 2, 2026
Mimesis is a robust Python library designed for generating fake yet realistic data across various languages and locales. It simplifies the creation of diverse data types, from personal information to financial details. This makes it an invaluable tool for development, testing, and anonymization tasks.

chardet: A Fast and Accurate Python Character Encoding Detector
August 2, 2026
chardet is a powerful Python library designed for universal character encoding detection. The recently rewritten version 7 offers significant improvements in accuracy and speed, making it a robust solution for identifying text encodings. It provides features like language and MIME type detection, along with a flexible API for various use cases.
python-Levenshtein: Fast Levenshtein Distance and String Similarity in Python
August 1, 2026
python-Levenshtein is a Python C extension module designed for high-performance computation of Levenshtein distance and various string similarity metrics. It provides functions for edit distance, string similarity, approximate median strings, and string sequence/set similarity, supporting both normal and Unicode strings. This library is a crucial tool for applications requiring efficient text comparison and analysis.
Source repository
Open the original repository on GitHub.