Registry / serialization / pyphonetics

pyphonetics

JSON →
library0.5.3pypypi✓ verified 86d ago

A Python 3 library for phonetic encoding algorithms including Soundex, Metaphone, Double Metaphone, and others. Current version is 0.5.3, with infrequent releases.

pip install pyphonetics
INSTALL
IMPORT
SIG · PYPHONETICS
P
pyphonetics
serializationpythonv0.5.3
Install
1.7s avg
Import
16ms
Disk
18MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.5.3 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.016s · 20.1MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.7s · import 0.016s · 21MB
18MB installed
● package 18MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Soundex
from pyphonetics import Soundex
Standard import path.
Metaphone
from pyphonetics import Metaphone
Standard import path.
DoubleMetaphone
from pyphonetics import DoubleMetaphone
Spelling exactly 'DoubleMetaphone' (no space).
FuzzySoundex
from pyphonetics import FuzzySoundex
Standard import path.

Encode a word using Soundex phonetic algorithm.

from pyphonetics import Soundex soundex = Soundex() print(soundex.phonetics('example'))
Debug
Known issues
deprecatedThe `phonetics` function returns a tuple in older versions but now returns a string; check return type.
fix
Update code to expect a string or use `from pyphonetics import Soundex; code = soundex.phonetics('word')` and treat as string.
affects: <=0.5.2
gotchaCase sensitivity: the library expects uppercase input for some algorithms; inconsistent behavior may occur.
fix
Always convert input to uppercase before passing: `soundex.phonetics(word.upper())`
affects: all
breakingIn version 0.5.0, the `phonetics` method was changed from returning a list/generator to returning a string for single results; DoubleMetaphone changed to return a tuple.
fix
Check the return type: for DoubleMetaphone, use `result = dm.phonetics(word); primary, secondary = result`.
affects: >=0.5.0
gotchaThe library does not support non-alphabetic characters well; numbers or punctuation may cause errors or silent failures.
fix
Sanitize input to only contain letters (A-Z) before encoding.
affects: all
Errors
Common errors & fixes
AttributeError: module 'pyphonetics' has no attribute 'Soundex'
Incorrect import: `import pyphonetics` then `pyphonetics.Soundex()`.
fix
Use `from pyphonetics import Soundex` directly.
TypeError: 'str' object is not callable
Overwriting the `phonetics` function variable name, e.g., `phonetics = 'foo'`.
fix
Avoid using `phonetics` as a variable name.
ValueError: The word must contain only letters
Input contains numbers or special characters.
fix
Strip non-alphabetic characters: `re.sub(r'[^A-Za-z]', '', word)`.
Upgrade
Version history
0.5.3latest on PyPI · released Feb 25, 2020
Audit
Dependencies

No dependency data recorded yet.

Agent activity
5 hits · last 30 days
node
4
Resources
pyphonetics — pip install pyphonetics · libregistry