Metaphone
A Python implementation of the metaphone and double metaphone algorithms.
What it is and what it does
Metaphone is a Python implementation of two phonetic encoding algorithms: the original Metaphone and Double Metaphone. Both produce approximate phonetic codes for English words and names to handle pronunciation variation and misspellings. Double Metaphone can return both primary and secondary codes to account for ambiguous cases and surname variants. For example, "Smith" encodes to SM0 and XMT while "Schmidt" encodes to XMT and SMT, sharing a common code.
The package has no runtime dependencies and is straightforward to use—import the algorithm function and pass a string to get back encoded phonetic codes. It's designed for applications like name matching in databases, full-text search, and handling user input with spelling variations. The implementation accounts for irregularities in English of Slavic, Germanic, Celtic, Greek, French, Italian, Spanish, Chinese, and other origins.
Use it for:
- Match user-entered names against a database by comparing their phonetic codes instead of exact strings
- Improve search results by finding words that sound similar despite different spellings
- Deduplicate records in a dataset where names may be misspelled or spelled phonetically
- Build a full-text search system that tolerates pronunciation-based variations in queries
- Handle names from multiple language origins with a single encoding approach
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Implements the Metaphone and Double Metaphone phonetic encoding algorithms to generate approximate phonetic codes for words and names, useful for fuzzy matching and handling misspellings.
Yes, if you need phonetic matching and can accept a dormant package. The algorithm is stable and well-tested, with no known vulnerabilities and permissive licensing. However, verify compatibility with your Python version first—requires_python is unspecified, and the last release was 2016-08-24. The high install friction and lack of recent maintenance are minor concerns for a mature, single-purpose library.
Install
metaphone on PyPI
pip
pip install metaphoneuv
uv add metaphonepoetry
poetry add metaphoneInstalling Metaphone
Before you install
High install friction due to source-only distribution. Package is dormant—last release was 2016-08-24, with no commits since 2024-02-28. No runtime dependencies, but the age and inactivity suggest limited ongoing maintenance.
License in practice
BSD license is permissive, allowing commercial and private use with minimal restrictions. No licensing barrier to adoption.
Quickstart
from metaphone import doublemetaphone
result = doublemetaphone("architect")
print(result) # (u"ARKTKT", u"")
requires_python is unspecified; verify compatibility with your Python version before installing
Verify before relying
- Whether the package works correctly on modern Python versions (requires_python is unspecified)
- Whether the source distribution builds without issues on current systems
- Performance characteristics and scalability for large datasets
Package facts
| License | BSD (permissive) |
| Python support | not specified |
| Install friction | high — source build required |
| Runtime dependencies | none |
| Maintenance | dormant — 3,642 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 272,666/month — #8,206 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: Metaphone-0.6.tar.gz
Tags
More Linguistic packages
Detects and normalizes text encoding from…
permissive · top 100 on PyPI
tiktokentiktoken is a fast BPE tokenizer that converts…
permissive · top 1,000 on PyPI
chardetDetects character encoding and language in byte…
permissive · top 1,000 on PyPI
text-unidecodeConverts Unicode text to ASCII by…
copyleft · top 1,000 on PyPI
larkLark is a parsing library that builds abstract…
permissive · top 1,000 on PyPI
tree-sitterPython bindings to the tree-sitter parsing…
permissive · top 1,000 on PyPI
phoneticsComputes phonetic keys of strings using…
permissive · top 15,000 on PyPI
pyphoneticsPyphonetics implements phonetic matching…
permissive · top 15,000 on PyPI
soundexImplements the Soundex phonetic algorithm for…
copyleft · top 15,000 on PyPI
pysimstringProvides fast approximate string matching and…
unclear · top 15,000 on PyPI
pronouncingProvides a simple Python interface to query the…
permissive · top 15,000 on PyPI
textdistanceComputes distance and similarity between text…
permissive · top 5,000 on PyPI
pyucaImplements the Unicode Collation Algorithm to…
permissive · top 15,000 on PyPI
pyspellcheckerDetects misspelled words and suggests…
permissive · top 5,000 on PyPI
phonemizerPhonemizer converts written text into phonetic…
copyleft · top 15,000 on PyPI
phonemizer-forkConverts text to phonetic representations…
copyleft · top 5,000 on PyPI