textstat — Readability & SEO Text Scoring
MIT-licensed Python library computing 12 readability scores (Flesch, Gunning Fog, SMOG, Dale-Chall, etc.) for content optimization and SEO.
textstat — Readability & SEO Text Scoring
textstat is a Python library with no heavy dependencies that computes a comprehensive set of readability and text complexity metrics. For content marketers and SEO specialists, it provides instant objective scores for any piece of copy — blog posts, landing pages, email subjects, ad copy — enabling data-driven content optimization and readability targeting by audience.
Key Features
- 12+ readability formulas: Flesch Reading Ease, Flesch-Kincaid Grade, Gunning Fog, SMOG Index, Automated Readability Index, Coleman-Liau, Linsear Write, Dale-Chall, and more
- Grade-level estimates for audience targeting
- Reading time estimation
- Syllable, word, sentence, and lexicon counting
- Multi-language support for international content teams
Quick Start
pip install textstat
import textstat
text = "Marketing teams use data analytics to optimize conversion funnels and improve customer retention across digital channels."
print(textstat.flesch_reading_ease(text)) # 0-100, higher = easier
print(textstat.flesch_kincaid_grade(text)) # US grade level
print(textstat.gunning_fog(text)) # Fog index
print(textstat.text_standard(text)) # Consensus grade
print(textstat.reading_time(text, ms_per_char=14.69)) # seconds
npx ai-supply add textstat-readability-scoring
Curated mirror of the open-source textstat (MIT). Get it from the source.
Compromise signals — malicious or tampered code (leaked secrets, backdoors, a dropped executable) — reduce the score, and known dependency CVEs carry a bounded penalty (they warrant review but never QUARANTINE — update the dependency to clear). Other dangerous-by-capability traits are risk surface, expected for some capabilities. Every finding is mapped to its OWASP control below.
Findings mapped to the OWASP Top 10 for LLM Applications (2025) and the OWASP Machine Learning Security Top 10. Expand any flagged control for the exact findings — compromise reduces the score; expected/risk-surface do not, except a known CVE, which carries a small bounded penalty (high/critical → Review).
The same gate an agent runs before installing (POST /api/v1/trust/textstat-readability-scoring/check). Click a policy:
Consume textstat — Readability & SEO Text Scoring programmatically. Authenticate with an API key or session — see Authorize an agent.
# Agents: CHECK BEFORE YOU INSTALL (no auth) — score, grade, level, capability manifest
curl https://ai-supply.store/api/v1/trust/textstat-readability-scoring
# Gate against your org policy (returns { pass, violations })
curl -X POST https://ai-supply.store/api/v1/trust/textstat-readability-scoring/check \
-H "Content-Type: application/json" \
-d '{"minGrade":"B","denyPermissions":["shell"],"denyUnknownEgress":true}'
# CLI
npx ai-supply add textstat-readability-scoring
# REST (install → download)
curl -X POST https://ai-supply.store/api/v1/listings/textstat-readability-scoring/install \
-H "Authorization: Bearer $AIM_KEY"
# MCP tool
install_listing({ "slug": "textstat-readability-scoring" })OpenAPI spec →Curated mirror — latest upstream source. See the repository for tagged releases.