{"id":9761,"library":"fuzzy","title":"Fuzzy","description":"Fuzzy is a Python library providing fast implementations of phonetic algorithms such as Soundex, NYSIIS, Metaphone, and Double Metaphone. It is currently at version 1.2.2. Its release cadence is generally infrequent, focusing on stability and bug fixes for its core set of algorithms.","status":"active","version":"1.2.2","language":"python","source_language":"en","source_url":"https://github.com/yougov/Fuzzy","tags":["phonetic","soundex","nysiis","metaphone","double metaphone","algorithm","string matching"],"install":[{"cmd":"pip install fuzzy","lang":"bash","label":"Install latest version"}],"dependencies":[],"imports":[{"note":"While direct import may work in some environments, the official and most robust way to access algorithms is via the fuzzy module object.","wrong":"from fuzzy import soundex","symbol":"soundex","correct":"import fuzzy\nfuzzy.soundex('example')"},{"note":"Access phonetic algorithms directly from the fuzzy module.","symbol":"nysiis","correct":"import fuzzy\nfuzzy.nysiis('example')"},{"note":"Access phonetic algorithms directly from the fuzzy module.","symbol":"metaphone","correct":"import fuzzy\nfuzzy.metaphone('example')"},{"note":"Access phonetic algorithms directly from the fuzzy module. Note that dm_metaphone returns a tuple.","symbol":"dm_metaphone","correct":"import fuzzy\nfuzzy.dm_metaphone('example')"}],"quickstart":{"code":"import fuzzy\n\nword = 'Washington'\nsoundex_code = fuzzy.soundex(word)\nnysiis_code = fuzzy.nysiis(word)\nmetaphone_code = fuzzy.metaphone(word)\ndm_metaphone_code = fuzzy.dm_metaphone(word)\n\nprint(f\"Original: {word}\")\nprint(f\"Soundex: {soundex_code}\")\nprint(f\"NYSIIS: {nysiis_code}\")\nprint(f\"Metaphone: {metaphone_code}\")\nprint(f\"Double Metaphone: {dm_metaphone_code}\")","lang":"python","description":"This example demonstrates how to import the fuzzy library and apply its main phonetic algorithms (Soundex, NYSIIS, Metaphone, Double Metaphone) to a given word, printing the resulting codes."},"warnings":[{"fix":"Always unpack or index the result of `dm_metaphone`, e.g., `code1, code2 = fuzzy.dm_metaphone('example')`.","message":"The `dm_metaphone` (Double Metaphone) function returns a tuple of two phonetic codes (or one code and None), unlike other algorithms which return a single string.","severity":"gotcha","affected_versions":">=1.1.0"},{"fix":"Ensure inputs are cast to strings, e.g., `fuzzy.soundex(str(my_number))` or handle potential `None` values before calling the functions.","message":"All phonetic algorithm functions strictly expect string inputs. Passing `None`, integers, or other non-string types will result in a `TypeError`.","severity":"gotcha","affected_versions":"All"}],"env_vars":null,"search_vec":"'1.2.2':26 'algorithm':12,44,51 'bug':37 'cadenc':29 'core':41 'current':23 'doubl':19,49 'fast':8 'fix':38 'focus':33 'fuzzi':1,2 'general':31 'implement':9 'infrequ':32 'librari':6 'match':53 'metaphon':17,20,48,50 'nysii':16,47 'phonet':11,45 'provid':7 'python':5 'releas':28 'set':42 'soundex':15,46 'stabil':35 'string':52 'version':25","created_at":"2026-04-17T01:20:35.179554+00:00","updated_at":"2026-04-17T15:16:59.871976+00:00","problems":{"verify_error":"Traceback (most recent call last):\n  File \"<string>\", line 2, in <module>\nAttributeError: module 'fuzzy' has no attribute 'soundex'. Did you mean: 'Soundex'?"},"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"1.2.2","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/yougov/Fuzzy","docs":null,"changelog":null,"pypi":"https://pypi.org/project/fuzzy/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["data"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"skip","verified_at":"2026-06-28","last_verified":"2026-06-28","next_check":"2026-08-01","install_tag":null}}