Analyze text for word count, readability, reading time, and more. Reads files or stdin.
bash
# Analyze a file
python3 scripts/text_stats.py README.md
# Multiple files
python3 scripts/text_stats.py file1.txt file2.txt
# From stdin
echo "The quick brown fox jumps over the lazy dog." | python3 scripts/text_stats.py
# JSON output
python3 scripts/text_stats.py essay.md -f json
# Compact (key metrics only)
python3 scripts/text_stats.py chapter.txt --compact
MetricDescriptionWordsTotal word countCharactersTotal characters (with and without spaces)LinesTotal and non-blank line countSentences / ParagraphsCount of eachSyllablesEstimated syllable countUnique WordsVocabulary diversityAvg Word/Sentence LengthAverage sizesReading TimeEstimated at 238 WPMSpeaking TimeEstimated at 150 WPMFlesch Reading Ease0-100 scale (higher = easier)Flesch-Kincaid GradeUS grade level equivalentDifficultyEasy / Standard / Fairly Difficult / Difficult / Very Difficult
FlagDescription-f, --format``plain or json output--compactShow only words, sentences, reading time, grade, difficulty