textstat
Calculate statistical features from text
What it is and what it does
Textstat is a text analysis library that computes readability and complexity metrics using established linguistic formulas. It provides functions like Flesch Reading Ease, Flesch-Kincaid Grade Level, Gunning FOG, SMOG Index, Coleman-Liau Index, Dale-Chall Readability Score, and others—each returning a numerical score or grade level that estimates the difficulty of comprehending a given text.
The library supports multiple languages (en_US, de, es, fr, it, nl, pl, ru) with language-specific formula variants, and includes Spanish-specific readability tests. It depends on pyphen for hyphenation and nltk for linguistic processing. Most functions accept plain text and return a single metric; text_standard() synthesizes multiple formulas into a consensus grade estimate.
Use it for:
- Evaluate readability of educational content, documentation, or web copy before publication.
- Assess whether written material matches its intended audience's reading level.
- Analyze text complexity in academic or publishing workflows to guide revision.
- Compare readability across multiple documents or versions to track clarity improvements.
- Generate readability reports for content management or accessibility compliance.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Textstat calculates readability and complexity metrics from text using multiple established formulas, returning grade-level estimates and readability scores.
Yes. Textstat is actively maintained, has no known vulnerabilities, installs with low friction, and offers a straightforward API for a well-defined task. It is suitable for anyone needing to measure text readability or grade level, whether for educational, editorial, or accessibility purposes. The MIT license removes licensing concerns.
Install
textstat on PyPI
pip
pip install textstatuv
uv add textstatpoetry
poetry add textstatInstalling textstat
Before you install
Low friction install with three runtime dependencies (pyphen, nltk, setuptools). Active maintenance with recent release on 2026-02-18 and 1377 repository stars.
License in practice
MIT license permits unrestricted use, modification, and distribution with minimal obligations—suitable for commercial and proprietary projects.
Quickstart
pip install textstat
import textstat
text = "Playing games has always been thought to be important to the development of well-balanced and creative children."
print(textstat.flesch_reading_ease(text))
print(textstat.flesch_kincaid_grade(text))
nltk may require downloading language data on first use; see nltk documentation for setup if tokenization fails.
Verify before relying
- Whether nltk requires additional data downloads (e.g., corpora) beyond the package install for full functionality.
- Performance characteristics on very large texts or batch processing workloads.
- Accuracy comparison between the multiple readability formulas for specific use cases.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.6) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — pyphen, nltk, setuptools |
| Maintenance | actively maintained — 177 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,378,074/month — #3,983 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: textstat-0.7.13-py3-none-any.whl
Tags
More Text Processing packages
A drop-in replacement for Python's standard…
permissive · top 100 on PyPI
pyparsingpyparsing provides a library for building text…
permissive · top 1,000 on PyPI
docutilsDocutils converts plaintext documentation in…
unclear · top 1,000 on PyPI
RapidFuzzRapidFuzz provides fast fuzzy string matching…
permissive · top 1,000 on PyPI
tinycss2tinycss2 parses CSS strings into token and…
permissive · top 1,000 on PyPI
llama-parseLlamaParse parses complex documents (PDFs,…
permissive · top 1,000 on PyPI
rougeComputes ROUGE scores (Recall-Oriented…
unclear · top 5,000 on PyPI
textacytextacy extends spaCy's NLP capabilities with…
permissive · top 15,000 on PyPI
rubricRubric is a Python library for evaluating LLM…
permissive · top 15,000 on PyPI
accessCalculates spatial accessibility metrics to…
permissive · top 15,000 on PyPI
lexical-diversityCalculates lexical diversity metrics (TTR,…
permissive · top 15,000 on PyPI
rouge-chineseComputes ROUGE evaluation metrics for Chinese…
unclear · top 15,000 on PyPI
langdetectDetects the language of text input, supporting…
permissive · top 5,000 on PyPI
syllapyCounts syllables in English words, returning an…
permissive · top 5,000 on PyPI
text2numConverts natural language number words into…
permissive · top 15,000 on PyPI
detoxifyDetoxify classifies text comments for toxic…
permissive · top 15,000 on PyPI