Soundex

raw JSON →
1.1.3 verified Mon Apr 27 auth: no python

Soundex algorithm implementation for English and Indian languages. Version 1.1.3. Stable, low release cadence.

pip install soundex
error ModuleNotFoundError: No module named 'soundex'
cause Package not installed or wrong import casing.
fix
Run 'pip install soundex', then import using 'from soundex import Soundex'.
error ImportError: cannot import name 'soundex' from 'soundex'
cause Attempting to import 'soundex' instead of 'Soundex' (class).
fix
Use 'from soundex import Soundex' and instantiate with Soundex().
gotcha The module name is all lowercase 'soundex', not 'Soundex'. Import with from soundex import Soundex.
fix Use 'from soundex import Soundex' or 'import soundex'.
gotcha The library uses uppercase 'Soundex' for the class, but the function version 'soundex' is also available if imported differently.
fix Check documentation: the class-based API is preferred.

Create a Soundex instance and call soundex() on a word.

from soundex import Soundex
s = Soundex()
print(s.soundex('Washington'))  # Output: W252
print(s.soundex('Deus'))        # Output: D200