Registry / ai-ml / syllables

syllables

JSON →
library1.1.5pypypi✓ verified 83d ago

A Python package for estimating the number of syllables in words, based on the CMU Pronouncing Dictionary. Current version 1.1.5 (2026-01-11), released on PyPI about every 1-6 months with dependency fixes.

pip install syllables
INSTALL
IMPORT
SIG · SYLLABLES
S
syllables
ai-mlpythonv1.1.5
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

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

estimate
from syllables import estimate

Estimate syllable count for given words.

from syllables import estimate print(estimate('hello')) # Output: 2 print(estimate('cat')) # Output: 1 print(estimate('world')) # Output: 1
Debug
Known issues
deprecatedThe module 'syllables' was previously named 'syllables' but some old code may reference 'syllables.syllables' or 'from syllables import get_syllable_count'. Only 'from syllables import estimate' is correct.
fix
Change imports to 'from syllables import estimate'.
affects: 1.0.7+
gotchaThe function is case-insensitive since v1.0.7, but non-ASCII words may not be in the CMU dictionary and will fall back to a naive estimate.
fix
Test with non-English words; consider preprocessing.
affects: 1.0.7+
gotchaThe package uses the CMU Pronouncing Dictionary, which covers only American English. Words not in the dictionary (e.g., proper nouns, abbreviations) are estimated using a simple vowel-group count heuristic, which can be inaccurate.
fix
Check if the output is -1 for unknown words (actually estimate returns a count for anything; use try-except? No exception, just fallback). Ensure inputs are English words.
affects: All
Errors
Common errors & fixes
ImportError: cannot import name 'get_syllable_count' from 'syllables'
The function was renamed from 'get_syllable_count' to 'estimate' in an older version (v1.0.7+).
fix
Replace 'from syllables import get_syllable_count' with 'from syllables import estimate' and call 'estimate(word)'.
ModuleNotFoundError: No module named 'syllables'
Package not installed or environment not activated.
fix
Run 'pip install syllables'.
AttributeError: module 'syllables' has no attribute 'estimate'
The installed version is too old (pre-1.0.7) or the import is wrong.
fix
Upgrade: 'pip install --upgrade syllables'. Use 'from syllables import estimate'.
Upgrade
Version history
1.1.5latest on PyPI · released Jan 11, 2026
Audit
Dependencies
cmudictrequiredProvides the CMU Pronouncing Dictionary word-to-phoneme mappings.
Agent activity
9 hits · last 30 days
node
8
OpenAI (training)
1
Resources
syllables — pip install syllables · libregistry