{"id":28316,"library":"syllables","title":"syllables","description":"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.","status":"active","version":"1.1.5","language":"python","source_language":"en","source_url":"https://github.com/prosegrinder/python-syllables","tags":["syllables","natural language processing","pronunciation","cmu dictionary","phonetics"],"install":[{"cmd":"pip install syllables","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Provides the CMU Pronouncing Dictionary word-to-phoneme mappings.","package":"cmudict","optional":false}],"imports":[{"note":"","wrong":"","symbol":"estimate","correct":"from syllables import estimate"}],"quickstart":{"code":"from syllables import estimate\nprint(estimate('hello'))  # Output: 2\nprint(estimate('cat'))    # Output: 1\nprint(estimate('world'))  # Output: 1","lang":"python","description":"Estimate syllable count for given words."},"warnings":[{"fix":"Change imports to 'from syllables import estimate'.","message":"The 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.","severity":"deprecated","affected_versions":"1.0.7+"},{"fix":"Test with non-English words; consider preprocessing.","message":"The 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.","severity":"gotcha","affected_versions":"1.0.7+"},{"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.","message":"The 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.","severity":"gotcha","affected_versions":"All"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Replace 'from syllables import get_syllable_count' with 'from syllables import estimate' and call 'estimate(word)'.","cause":"The function was renamed from 'get_syllable_count' to 'estimate' in an older version (v1.0.7+).","error":"ImportError: cannot import name 'get_syllable_count' from 'syllables'"},{"fix":"Run 'pip install syllables'.","cause":"Package not installed or environment not activated.","error":"ModuleNotFoundError: No module named 'syllables'"},{"fix":"Upgrade: 'pip install --upgrade syllables'. Use 'from syllables import estimate'.","cause":"The installed version is too old (pre-1.0.7) or the import is wrong.","error":"AttributeError: module 'syllables' has no attribute 'estimate'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}