Skip to main content

phonetics

IPA-based phonetic distance for Python, built on a Rust core.

Install

pip install phonetics-ipa

The PyPI package is phonetics-ipa (the bare phonetics name is held by an unrelated metaphone library). The importable module is still phonetics:

import phonetics

Usage

import phonetics

# Strict per-phoneme acoustic distance, 0..1
phonetics.distance("p", "b")          # 0.15  (voicing flip)
phonetics.distance("ɑ", "ɔ")          # ~0.21 (acoustically distinct)

# Listener-confusion distance, Mad Gab calibrated
target = "ɪtsdʒʌstəstupɪdgeɪm"        # "It's just a stupid game"
clue   = "hɪtsdʒʌstɪsduphɪdkeɪm"      # "Hits Justice Dupe Hid Came"
phonetics.confusion(target, clue)     # ~0.77
phonetics.similarity(target, clue)    # ~0.96  (high listener overlap)

# Perceptual per-phoneme (with empirical confusion overlay)
phonetics.sub_cost("t", "ɾ")          # ~0.10 (American t-flapping)
phonetics.sub_cost("ɑ", "ɔ")          # ~0.05 (cot/caught merger, WCE)

# Tokenisation
phonetics.tokenize("kɑɪt")            # ['k', 'ɑɪ', 't']  (diphthong atomic)
phonetics.tokenize("it is", boundaries=True)  # ['i', 't', '#', 'i', 's']

See https://github.com/JackDanger/phonetics for the extended write-up of the metric design and the parity tests against Mad Gab puzzles.

License

MIT.

Metadata

Release files for phonetics-ipa 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for phonetics-ipa 0.2.0
File Size Uploaded Provenance Actions
phonetics_ipa-0.2.0.tar.gz 26.1 kB With provenance Details for phonetics_ipa-0.2.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for phonetics-ipa 0.2.0
File Actions
phonetics_ipa-0.2.0-cp39-abi3-win_amd64.whl CPython 3.9 abi3 Windows x86-64 Details for phonetics_ipa-0.2.0-cp39-abi3-win_amd64.whl
phonetics_ipa-0.2.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.9 abi3 Linux glibc 2.17+ x86-64 Details for phonetics_ipa-0.2.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
phonetics_ipa-0.2.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.9 abi3 Linux glibc 2.17+ ARM64 Details for phonetics_ipa-0.2.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
phonetics_ipa-0.2.0-cp39-abi3-macosx_11_0_arm64.whl CPython 3.9 abi3 macOS 11.0+ ARM64 Details for phonetics_ipa-0.2.0-cp39-abi3-macosx_11_0_arm64.whl

Total release size: 897.0 kB

Release files / phonetics_ipa-0.2.0.tar.gz

Download URL phonetics_ipa-0.2.0.tar.gz
Size 26.1 kB
Tags Source
SHA-256 checksum
How to use checksums
5785103f3fa5cbb8cf97537d9105a7fcdd937c09e98e3d6c3c10c099adea6303
BLAKE2b-256 checksum
How to use checksums
0f5468158381daa6a908e555e1710e01621ccf0ca1d88c8cbf38efac597d6079
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 12, 2026.

Transparency log

Release files / phonetics_ipa-0.2.0-cp39-abi3-win_amd64.whl

Download URL phonetics_ipa-0.2.0-cp39-abi3-win_amd64.whl
Size 123.4 kB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
d2eb3eae976c9cc3b9c01a86f99e2fd4312d85c858c3ff47507e439d298152f0
BLAKE2b-256 checksum
How to use checksums
03911c0033ef3a8e2f09ed70512258620575b747d3136104f219cd8d5bd57f13
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 12, 2026.

Transparency log

Release files / phonetics_ipa-0.2.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL phonetics_ipa-0.2.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 262.7 kB
Tags CPython 3.9 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
5e85c56d4f01ef3cc3a0a8dbf9a4464e66a51306bd4e6050fb9545ea71ed3117
BLAKE2b-256 checksum
How to use checksums
8b8069174ed5220cf4068623f119c17ee7bf85021f7456062c42225e61645ed1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 12, 2026.

Transparency log

Release files / phonetics_ipa-0.2.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL phonetics_ipa-0.2.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 260.1 kB
Tags CPython 3.9 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
81385d5d56561cf8e7c8654eaee90627542ea1b7230373fc4a7cbb7932749b63
BLAKE2b-256 checksum
How to use checksums
f4faaffb845608fa0745d0e20b8d0a87504b87fd61123ab39f2e60b7acc2f66a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 12, 2026.

Transparency log

Release files / phonetics_ipa-0.2.0-cp39-abi3-macosx_11_0_arm64.whl

Download URL phonetics_ipa-0.2.0-cp39-abi3-macosx_11_0_arm64.whl
Size 224.8 kB
Tags CPython 3.9 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
6b7790b8ecf8a0750a8f06f49623cd0d995cc1160d87a0adff1e91cb9570062b
BLAKE2b-256 checksum
How to use checksums
70b2bc554d26a8dfa95e6516deaf276ca43a4372b3c674b26a09fce37ed2c2d1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 12, 2026.

Transparency log

Security for phonetics-ipa 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 5 files in this release have been uploaded with provenance metadata.

Select from 5 files

Attestation for phonetics_ipa-0.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 12, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

5 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page