Thanks to visit codestin.com
Credit goes to github.com

Skip to content

textstat/textstat

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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

About

📝 python package to calculate readability statistics of a text object - paragraphs, sentences, articles.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Contributors 42