Skip to main content

Textstat is an easy to use Python library that analyzes text to provide detailed statistics, readability scores, and complexity metrics. Perfect for content analysis, education, and natural language processing.

Project description

Textstat

Textstat is an easy to use Python library that analyzes text to provide detailed statistics, readability scores, and complexity metrics. Perfect for content analysis, education, and natural language processing.

GitHub Workflow Status (main) License PyPI version PyPI - Downloads

Photo by Patrick Tomasso on Unsplash

Usage

>>> from textstat import Text, Sentence, Word

>>> my_text = Text(
  "Alice was beginning to get very tired of sitting by her sister on the "
  "bank, and of having nothing to do: once or twice she had peeped into "
  "the book her sister was reading, but it had no pictures or "
  "conversations in it, “and what is the use of a book,” thought Alice "
  "“without pictures or conversations?”"
)

>>> my_text.stats()
{'letters': 236, 'characters': 246, 'words': 57, 'sentences': 1}

>>> my_text.flesch_reading_ease()
31.727368421052645

>>> my_text.filter(Word.length >= 10)
[Word('conversations'), Word('conversations')]

For full documentation, see https://docs.textstat.org/

Installation

textstat is available on PyPi and Conda Forge.

pip install textstat
conda install textstat

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

textstat-1.0.0a0.tar.gz (110.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

textstat-1.0.0a0-py3-none-any.whl (109.9 kB view details)

Uploaded Python 3

File details

Details for the file textstat-1.0.0a0.tar.gz.

File metadata

  • Download URL: textstat-1.0.0a0.tar.gz
  • Upload date:
  • Size: 110.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.24

File hashes

Hashes for textstat-1.0.0a0.tar.gz
Algorithm Hash digest
SHA256 f90cd32f042a375e4af8a36f8916601d46f3bc1b5415cc75bfe7ddc03bd79c80
MD5 0f47deaee7d63801aa429b62f1d776a4
BLAKE2b-256 e6dfd787d81ebeaabcb2ad8470d9aca1ded20df5152e3d5cc231a9af6bd3a538

See more details on using hashes here.

File details

Details for the file textstat-1.0.0a0-py3-none-any.whl.

File metadata

  • Download URL: textstat-1.0.0a0-py3-none-any.whl
  • Upload date:
  • Size: 109.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.24

File hashes

Hashes for textstat-1.0.0a0-py3-none-any.whl
Algorithm Hash digest
SHA256 6e094b05b20d64772db003c7e8e343fb792f0502dddf75c77d18e44c05e8f6f2
MD5 6884079e464759041cccaca52c1875b6
BLAKE2b-256 0acb72e00c84faa51cb9fd064538367df055431b51a487cf46ba8ce1b145804c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page