From 4b98fa4be63d623de55dca82130a298a854e9015 Mon Sep 17 00:00:00 2001 From: PurpleSwtr Date: Sun, 12 Jul 2026 20:45:40 +0300 Subject: [PATCH] [tool] reading_time (#163) --- tools/reading_time.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 tools/reading_time.py diff --git a/tools/reading_time.py b/tools/reading_time.py new file mode 100644 index 0000000..b5cda21 --- /dev/null +++ b/tools/reading_time.py @@ -0,0 +1,19 @@ +# tool: reading_time +# description: Estimates reading time in minutes (assuming 200 wpm) +# author: @PurpleSwtr +# example: reading_time "400 words of text here" -> "2" + + +import sys + + +def run(*args) -> str: + text = args[0] if args else sys.stdin.read() + + word_count = len(text.strip().split()) + + if word_count == 0: + return "0" + + minutes = (word_count + 100) // 200 + return str(minutes)