# Fuzzywuzzy: Python Library for Fuzzy String Matching

This repository profile is provided by osrepos.com, an open source repository discovery platform.

Source: osrepos.com
Repository profile: https://osrepos.com/repo/seatgeek-fuzzywuzzy
Generated for open source discovery and AI-assisted research.

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.

GitHub: https://github.com/seatgeek/fuzzywuzzy
OSRepos URL: https://osrepos.com/repo/seatgeek-fuzzywuzzy

## 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.

## Topics

- Python
- Fuzzy Matching
- String Comparison
- NLP
- Data Cleaning
- Levenshtein Distance
- Open Source

## Repository Information

Last analyzed by OSRepos: Sat Aug 01 2026 21:29:15 GMT+0100 (Western European Summer Time)
Detail views: 0
GitHub clicks: 0

## Safety Notice

OSRepos shares public repositories for knowledge and discovery only. Review source code, dependencies, licenses, and security implications before running or installing anything.

## Content

## 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](https://github.com/seatgeek/thefuzz){:target="_blank"}, 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.

bash
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.

python
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

*   [Fuzzywuzzy GitHub Repository](https://github.com/seatgeek/fuzzywuzzy){:target="_blank"}
*   [TheFuzz GitHub Repository (Recommended)](https://github.com/seatgeek/thefuzz){:target="_blank"}