{"id":1487,"library":"fuzzywuzzy","title":"FuzzyWuzzy","description":"FuzzyWuzzy is a Python library that implements fuzzy string matching, often used for comparing the similarity between two strings. It leverages Levenshtein distance to calculate ratios between strings. The current version is 0.18.0. Its release cadence has been infrequent in recent years.","status":"active","version":"0.18.0","language":"en","source_language":"en","source_url":"https://github.com/seatgeek/fuzzywuzzy","tags":["string matching","fuzzy logic","levenshtein distance","nlp"],"install":[{"cmd":"pip install fuzzywuzzy","lang":"bash","label":"Basic Installation"},{"cmd":"pip install fuzzywuzzy[speedup]","lang":"bash","label":"With C++ Speedup (python-levenshtein)"}],"dependencies":[{"reason":"Provides a C++ implementation of Levenshtein distance for significant speed improvements, especially on large datasets.","package":"python-levenshtein","optional":true}],"imports":[{"symbol":"fuzz","correct":"from fuzzywuzzy import fuzz"},{"note":"The 'process' module, containing functions like extract, is a top-level import, not nested under 'fuzz'.","wrong":"from fuzzywuzzy.fuzz import process","symbol":"process","correct":"from fuzzywuzzy import process"}],"quickstart":{"code":"from fuzzywuzzy import fuzz\nfrom fuzzywuzzy import process\n\n# Simple Ratio\nprint(fuzz.ratio(\"this is a test\", \"this is a test!\"))\n\n# Partial Ratio\nprint(fuzz.partial_ratio(\"this is a test\", \"this is a test!\"))\n\n# Token Sort Ratio\nprint(fuzz.token_sort_ratio(\"fuzzy wuzzy was a bear\", \"wuzzy fuzzy was a bear\"))\n\n# Token Set Ratio\nprint(fuzz.token_set_ratio(\"fuzzy wuzzy was a bear\", \"wuzzy fuzzy was a bear\"))\n\nchoices = [\"apple jack\", \"apple mac\", \"apple sauce\", \"orange juice\"]\nprint(process.extract(\"apple\", choices, scorer=fuzz.ratio))\nprint(process.extractOne(\"apple goop\", choices))","lang":"python","description":"Demonstrates basic usage of `fuzz` for various ratio calculations and `process` for extracting best matches from a list of choices."},"warnings":[{"fix":"Install with `pip install fuzzywuzzy[speedup]` to include the C++ optimized `python-levenshtein` library.","message":"Without the optional `python-levenshtein` dependency, FuzzyWuzzy can be very slow for large datasets or frequent comparisons. The pure Python implementation is significantly less performant.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Be aware of the `processor` argument in functions like `process.extract` and consider implementing custom preprocessing if the default behavior is not suitable. For `fuzz` functions, you might need to preprocess strings yourself before passing them.","message":"FuzzyWuzzy's default string preprocessing (e.g., lowercasing, removing non-alphanumeric characters, and stripping whitespace) can sometimes lead to unexpected results if you need to preserve specific case or punctuation for your matching logic.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Consider alternatives like 'thefuzz' (a maintained fork) or 'rapidfuzz' for actively developed and often more performant solutions if long-term support or advanced features are critical.","message":"The library appears to be in a low-maintenance state, with the last release (0.18.0) in 2017. While functional, active development and new features are unlikely.","severity":"deprecated","affected_versions":"Since 0.18.0"},{"fix":"Always check that the list of choices passed to `process` functions is not empty before making the call.","message":"When using `process.extract` or `process.extractOne`, ensure your `choices` list is not empty, as this can lead to errors or unexpected behavior depending on the FuzzyWuzzy version and specific call.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-08T00:00:00.000Z","next_check":"2026-07-07T00:00:00.000Z"}