Skip to main content

pysyllables

An in-memory syllable count dictionary for North American English derived from the CMU Pronouncing Dictionary.

>>> from pysyllables import get_syllable_count
>>> get_syllable_count("fabulous")
3
>>> get_syllable_count("word-that-doesn't-exist")
None

Where do these syllable counts come from?

From the CMU Pronouncing Dictionary, an open-source machine-readable pronunciation dictionary for North American English that contains over 134,000 words and their pronunciations.

By counting the number of lexical stress markers in each word's pronunciation, we can compute the # of syllables in each word. This library ships with a file that maps each word to a syllable count in pysyllables/syllable-counts.txt

How does one generate pysyllables/syllable-counts.txt?

scripts/download_syllable_counts.sh downloads the CMU Pronouncing Dictionary, computes each word's syllable count, and emits pysyllables/syllable-counts.txt.

Should there be a new version of the CMU Pronouncing Dictionary, update the source in scripts/download_syllable_counts.sh.

Contributing

Questions & contributions welcome -- please open an issue or, even better, a PR!

Metadata

Release files for pysyllables 1.0.3

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

Source distribution (sdist)

Source distribution for pysyllables 1.0.3
File Size Uploaded Provenance Actions
pysyllables-1.0.3.tar.gz 431.8 kB Without provenance Details for pysyllables-1.0.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pysyllables 1.0.3
File Interpreter ABI Platform Actions
pysyllables-1.0.3-py2.py3-none-any.whl Python 3, Python 2 none any Details for pysyllables-1.0.3-py2.py3-none-any.whl

Total release size: 858.7 kB

Release files / pysyllables-1.0.3.tar.gz

Download URL pysyllables-1.0.3.tar.gz
Size 431.8 kB
Tags Source
SHA-256 checksum
How to use checksums
ed00747b783d471a5cdf0052e5f2ed36e631df098bd4a876dc1bf62436f9b85d
BLAKE2b-256 checksum
How to use checksums
bcbcc3d16807c4160a59a2357be3e65e79fdbd3c77daec70e8c2dc93614e1d72
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3

Release files / pysyllables-1.0.3-py2.py3-none-any.whl

Download URL pysyllables-1.0.3-py2.py3-none-any.whl
Size 426.9 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
d6dfcc135086e1f041821cdf9a92864514a4547364d334f40b6223b370b30d29
BLAKE2b-256 checksum
How to use checksums
58e969f90cdc5880c144e94c54593d0f3b4317446a2c6fd702f59908d1b35c3b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.3

Security for pysyllables 1.0.3

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

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