Skip to main content

A Python 3 phonetics library.

Project description

Pyphonetics is a Python 3 library for phonetic algorithms. Right now, the following algorithms are implemented and supported:

  • Soundex

  • Metaphone

  • Refined Soundex

  • Fuzzy Soundex

  • Lein

  • Matching Rating Approach

More will be added in the future.


The module is available in PyPI, just use pip install pyphonetics.


>>> from pyphonetics import Soundex
>>> soundex = Soundex()
>>> soundex.phonetics('Rupert')
>>> soundex.phonetics('Robert')
>>> soundex.sounds_like('Robert', 'Rupert')

The same API applies to every algorithm, e.g:

>>> from pyphonetics import Metaphone
>>> metaphone = Metaphone()
>>> metaphone.phonetics('discrimination')

You can also use the distance(word1, word2, metric=’levenshtein’) method to find the distance between 2 phonetic representations.

>>> from pyphonetics import RefinedSoundex
>>> rs = RefinedSoundex()
>>> rs.distance('Rupert', 'Robert')
>>> rs.distance('assign', 'assist', metric='hamming')


The module was largely based on the implementation of phonetic algorithms found in the Talisman.js ( Node NLP library.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyphonetics-0.5.3.tar.gz (10.3 kB view hashes)

Uploaded source

Built Distribution

pyphonetics-0.5.3-py2.py3-none-any.whl (10.7 kB view hashes)

Uploaded py2 py3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page