Registry / data / pronouncing

pronouncing

JSON →
library0.3.0pypypi✓ verified 88d ago

Pronouncing is a lightweight Python library providing a simple interface to the CMU Pronouncing Dictionary. It allows users to programmatically access phonetic pronunciations, find rhyming words, count syllables, and search for words based on phonetic patterns. The current version is 0.2.0, with releases historically being infrequent, the last major update in 2018.

pip install pronouncing
INSTALL
IMPORT
SIG · PRONOUNCING
P
pronouncing
datapythonv0.3.0
Install
1.9s avg
Import
111ms
Disk
20MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v0.3.0 · 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.10–3.920 runs
installs and imports cleanly · install 0.0s · import 0.116s · 22.1MB
glibc
py 3.10–3.920 runs
installs and imports cleanly · install 1.9s · import 0.105s · 23MB
20MB installed
● package 20MB
Code
Verified usage

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

pronouncing
✓ import pronouncing

This quickstart demonstrates how to find rhymes, retrieve phonetic pronunciations in ARPAbet, and count syllables for a given word using the `pronouncing` library.

import pronouncing word = "climbing" rhymes = pronouncing.rhymes(word) print(f"Rhymes for '{word}': {rhymes}") pronunciations = pronouncing.phones_for_word(word) print(f"Pronunciations for '{word}': {pronunciations}") syllables = pronouncing.syllable_count(pronunciations[0]) # Use the first pronunciation for syllable count print(f"Syllable count for '{word}': {syllables}")
Debug
Known issues
breakingVersion 0.2.0 removed the CMU Pronouncing Dictionary data directly from the package. It now relies on the `cmudict` package as a dependency to provide this data. If upgrading from an older version (pre-0.2.0), ensure `cmudict` is installed.
fix
Ensure `cmudict` is installed alongside `pronouncing`. `pip install pronouncing` should handle this, but manual intervention might be needed for older environments or direct source installations. `pip install cmudict`
affects: <0.2.0
gotchaThe `pronouncing.phones_for_word()` function can return multiple pronunciations for a single word, reflecting different possible ways a word can be spoken. The library does not provide built-in logic to determine the 'best' or 'most common' pronunciation.
fix
Applications using `phones_for_word()` should implement their own criteria for selecting the appropriate pronunciation from the returned list, based on their specific use case (e.g., always taking the first, or applying a custom ranking).
affects: 0.1.1 and later
gotchaThe library's development seems to be low-activity, with the last release (0.2.0) in 2018. While functional, new features or active maintenance should not be expected.
fix
Be aware of the library's maintenance status. For projects requiring active development, frequent updates, or new linguistic features, consider alternatives or be prepared to fork and maintain the library yourself.
affects: 0.2.0
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'pronouncing'
The 'pronouncing' library has not been installed in your current Python environment, or there is a typo in the import statement.
fix
Install the package using pip: `pip install pronouncing`
IndexError: list index out of range
This typically occurs when a word is not found in the CMU Pronouncing Dictionary, causing functions like `pronouncing.phones_for_word()` to return an empty list. Subsequently attempting to access an element (e.g., `[0]`) from this empty list will raise an `IndexError`.
fix
Always check if the list returned by 'pronouncing' functions is not empty before trying to access its elements. For example: `pronunciations = pronouncing.phones_for_word('nonexistent'); if pronunciations: print(pronunciations[0])`
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x... in position ...: invalid start byte
This error occurs when attempting to process text data (e.g., from a file, user input, or custom dictionary entries) that contains characters encoded in a different format than 'utf-8', or if the text is corrupted. Given the library's focus on phonetic data, this can happen with non-standard characters in input words or dictionary paths.
fix
Ensure all text inputs and file operations explicitly specify the correct encoding that matches the data (e.g., 'latin-1', 'cp1252', or the actual encoding of your source text). When reading files, use `open('filename', encoding='correct_encoding')`.
Upgrade
Version history
0.3.0latest on PyPI · released Apr 17, 2026
Audit
Dependencies
cmudictrequiredProvides the CMU Pronouncing Dictionary data. As of version 0.2.0, the dictionary data was removed from the 'pronouncing' package and is now a dependency on 'cmudict'.
Agent activity
2 hits · last 30 days
node
2
Resources
pronouncing — pip install pronouncing · libregistry