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.
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file textstat-1.0.0a1.tar.gz.
File metadata
- Download URL: textstat-1.0.0a1.tar.gz
- Upload date:
- Size: 118.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.24
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f90fe4cc70cbe34c84390ee14d8c6fd50167b5101100c32d15d9b820b37e802a
|
|
| MD5 |
f117eb6ddc64669e53780c653a4e7357
|
|
| BLAKE2b-256 |
9a842e7f6cfdb44e3f0c62bbf2137c2d8b35fdd084b00cb72bcfc0bfca1b0d31
|
File details
Details for the file textstat-1.0.0a1-py3-none-any.whl.
File metadata
- Download URL: textstat-1.0.0a1-py3-none-any.whl
- Upload date:
- Size: 124.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.24
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
80cf4db538dc72027304fd40c5e9bcfd037b4b7f479e3e07a9ed939c14e94e54
|
|
| MD5 |
4a3c9c277cb14bca3dda03b0737d357e
|
|
| BLAKE2b-256 |
9bbc45bfb39243b6cf6f9b6d9691b6a2e7a25d2d1a932eab30d5961ed89ec2ab
|