Text Stats

Other

Analyze text files for word count, character count, line count, sentence count, reading time, speaking time, readability scores (Flesch Reading Ease, Flesch-Kincaid Grade Level), and vocabulary statistics. Use when counting words, analyzing readability, estimating reading time, or getting text metrics for documents, essays, blog posts, or any text content.

Install

openclaw skills install jrv-text-stats

Text Stats

Analyze text for word count, readability, reading time, and more. Reads files or stdin.

Quick Start

# 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

Output Metrics

MetricDescription
WordsTotal word count
CharactersTotal characters (with and without spaces)
LinesTotal and non-blank line count
Sentences / ParagraphsCount of each
SyllablesEstimated syllable count
Unique WordsVocabulary diversity
Avg Word/Sentence LengthAverage sizes
Reading TimeEstimated at 238 WPM
Speaking TimeEstimated at 150 WPM
Flesch Reading Ease0-100 scale (higher = easier)
Flesch-Kincaid GradeUS grade level equivalent
DifficultyEasy / Standard / Fairly Difficult / Difficult / Very Difficult

Options

FlagDescription
-f, --formatplain or json output
--compactShow only words, sentences, reading time, grade, difficulty

Notes

  • No external dependencies (Python 3 stdlib only)
  • Handles UTF-8 text with graceful fallback for encoding errors
  • Syllable counting is heuristic-based (English-optimized)