Registry / data / panphon

panphon

JSON →
library0.22.2pypypi✓ verified 84d ago

Tools for using the International Phonetic Alphabet (IPA) with phonological features. Supports feature extraction, segment similarity, alignment, and manipulation of Unicode IPA strings. Current version 0.22.2, release cadence irregular.

pip install panphon
INSTALL
IMPORT
SIG · PANPHON
P
panphon
datapythonv0.22.2
Install
9.6s avg
Import
1072ms
Disk
178MB
Pass rate
8/ 10
Env Coverage8 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.22.2 · 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
glibc
py 3.10
✓ —
✓ 9s
py 3.11
✓ —
✓ 8.7s
py 3.12
✓ —
✓ 10s
py 3.13
✕ build_error
✕ build_error
py 3.9
✓ —
✓ 10.7s
178MB installed
● package 178MB
Code
Verified usage

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

FeatureTable
from panphon import FeatureTable
Segment
from panphon.segment import Segment
IPA
from panphon import IPA

Load feature table, get feature vectors, compute segment distances.

from panphon import FeatureTable ft = FeatureTable() # Feature vector for a segment vec = ft.word_fts('p') print(vec) # Segment similarity sim = ft.hamming_distance('p', 'b') print(sim) # Feature-based edit distance from panphon.distance import Distance d = Distance() print(d.dolgo_prime_distance('pan', 'ban'))
Debug
Known issues
gotchaFeatureTable() loads a default feature set. If you need a custom set, pass a file path. The default is based on the 'panphon' bundle (SPE features plus extensions).
fix
Use FeatureTable('path/to/features.yaml') to load custom features.
affects: all
deprecatedThe `panphon.editdistance` module and its functions (e.g., `dolgo_prime_distance`) are deprecated in favor of `panphon.distance.Distance` class methods.
fix
Replace `from panphon.editdistance import dolgo_prime_distance` with `from panphon.distance import Distance; Distance().dolgo_prime_distance(...)`.
affects: >=0.19
gotchaThe `word_fts` method returns a list of feature vectors for each segment, not a single tensor. Iterate over the list to get individual segment vectors.
fix
Use `for vec in ft.word_fts('hello'):` to process each segment.
affects: all
Errors
Common errors & fixes
ImportError: No module named 'panphon.editdistance'
The `editdistance` module was removed in version 0.19. Use `panphon.distance` instead.
fix
Use `from panphon.distance import Distance` and call methods like `Distance().dolgo_prime_distance(...)`.
YAML load error.
Deprecated YAML.load call in older versions (fixed in 0.19). Update to 0.19+ or use safe loader.
fix
Upgrade to panphon 0.19 or later: `pip install --upgrade panphon`.
Upgrade
Version history
0.22.2latest on PyPI · released Jun 12, 2025
Audit
Dependencies
numpyrequiredarray operations
PyYAMLrequiredloading feature data
Agent activity
7 hits · last 30 days
node
6
Amazon
1
Resources