CLI to calculates the time some text takes the average human to read, based on Medium's read time forumula.
Project description
📖 Readtime-CLI
CLI to calculates the time some text takes the average human to read, based on Medium's read time forumula.
🧮 Algorithm
Medium's Help Center says,
Read time is based on the average reading speed of an adult (roughly 265 WPM). We take the total word count of a post and translate it into minutes, with an adjustment made for images. For posts in Chinese, Japanese and Korean, it's a function of number of characters (500 characters/min) with an adjustment made for images.
Double checking with real articles, the English algorithm is:
seconds = num_words / 265 * 60 + img_weight * num_images
With img_weight
starting at 12
and decreasing one second with each image encountered, with a minium img_weight
of 3
seconds.
Requirements
Python 3.9+
Readtime-CLI stands on the shouders of giants:
🛠 Installation
Poetry
poetry add readtime-cli
Pip
virtualenv venv
. venv/bin/activate
pip install readtime-cli
💻 Usage
Version
readtime version
Calculate Read time Markdown files
readtime md FILE_PATH [OPTIONS]
Calculate Read time HTML files
readtime html FILE_PATH [OPTIONS]
Calculate Read time Text files
readtime text FILE_PATH [OPTIONS]
Options for all commands
--wpm INTEGER Word Per Minute [default: 265]
--help Show help and exit.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for readtime_cli-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 432eda17cc2e5114db92996eae9f4d74f8e79722955d7ca4f9745976ca3ae23d |
|
MD5 | a7d1787d98a560100d8361e5d685d771 |
|
BLAKE2b-256 | e712e589b4038132a57aa48d89c4dc1c123c4e83cd4cc3b9cef455bb8b0e2491 |