<h1 align="center">
📖 Readtime-CLI
</h1>
<p align="center">
<a href="https://github.com/guedesfelipe/readtime_cli/actions/workflows/ci.yml" target="_blank">
<img src="https://github.com/guedesfelipe/readtime_cli/actions/workflows/ci.yml/badge.svg?branch=main" />
</a>
<a href="https://github.com/guedesfelipe/readtime_cli/actions/workflows/security.yml" target="_blank">
<img src="https://github.com/guedesfelipe/readtime_cli/actions/workflows/security.yml/badge.svg?branch=main" />
</a>
<a href="https://codecov.io/gh/guedesfelipe/readtime_cli" target="_blank">
<img src="https://codecov.io/gh/guedesfelipe/readtime_cli/branch/main/graph/badge.svg" />
</a>
<a href="https://pypi.org/project/readtime-cli/" target="_blank">
<img src="https://img.shields.io/pypi/v/readtime-cli?color=%2334D058&label=pypi%20package" />
</a>
<a href="" target="_blank">
<img src="https://img.shields.io/pypi/pyversions/readtime-cli.svg?color=%2334D058&logo=python&logoColor=yellow" />
</a>
</p>
<p align="center">
<em>CLI to calculates the time some text takes the average human to read, based on Medium's <a href="https://help.medium.com/hc/en-us/articles/214991667-Read-time" target="_blank">read time forumula</a>.</em>
</p>
## 🧮 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.
[Source](https://help.medium.com/hc/en-us/articles/214991667-Read-time)
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
MacOS or Linux
Python 3.9+
Readtime-CLI stands on the shouders of giants:
* [Typer](https://github.com/tiangolo/typer)
* [Readtime](https://github.com/alanhamlett/readtime)
## 🛠Installation
### Poetry
poetry add readtime-cli
### Pip
virtualenv venv
. venv/bin/activate
pip install readtime-cli
## 💻 Usage
### Version
```sh
readtime version
```
### Calculate Read time Markdown files
```sh
readtime md FILE_PATH [OPTIONS]
```
### Calculate Read time HTML files
```sh
readtime html FILE_PATH [OPTIONS]
```
### Calculate Read time Text files
```sh
readtime text FILE_PATH [OPTIONS]
```
### Options for all commands
--wpm INTEGER Word Per Minute [default: 265]
--language [en|pt-br] [default: Languages.en]
--help Show this message and exit.
Raw data
{
"_id": null,
"home_page": "https://github.com/guedesfelipe/readtime_cli",
"name": "readtime-cli",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8,<3.11",
"maintainer_email": "",
"keywords": "python,readtime,readtime_cli,cli",
"author": "Felipe Guedes",
"author_email": "contatofelipeguedes@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/0f/a1/88dd6394eadd1b7f902f8ec7ae132aa4b2a0931655e375c333bbc6c6a3b9/readtime_cli-0.2.3.tar.gz",
"platform": null,
"description": "<h1 align=\"center\">\n \ud83d\udcd6 Readtime-CLI\n</h1>\n<p align=\"center\">\n <a href=\"https://github.com/guedesfelipe/readtime_cli/actions/workflows/ci.yml\" target=\"_blank\">\n <img src=\"https://github.com/guedesfelipe/readtime_cli/actions/workflows/ci.yml/badge.svg?branch=main\" />\n </a>\n <a href=\"https://github.com/guedesfelipe/readtime_cli/actions/workflows/security.yml\" target=\"_blank\">\n <img src=\"https://github.com/guedesfelipe/readtime_cli/actions/workflows/security.yml/badge.svg?branch=main\" />\n </a>\n <a href=\"https://codecov.io/gh/guedesfelipe/readtime_cli\" target=\"_blank\">\n <img src=\"https://codecov.io/gh/guedesfelipe/readtime_cli/branch/main/graph/badge.svg\" />\n </a>\n <a href=\"https://pypi.org/project/readtime-cli/\" target=\"_blank\">\n <img src=\"https://img.shields.io/pypi/v/readtime-cli?color=%2334D058&label=pypi%20package\" />\n </a>\n <a href=\"\" target=\"_blank\">\n <img src=\"https://img.shields.io/pypi/pyversions/readtime-cli.svg?color=%2334D058&logo=python&logoColor=yellow\" />\n </a>\n</p>\n\n<p align=\"center\">\n <em>CLI to calculates the time some text takes the average human to read, based on Medium's <a href=\"https://help.medium.com/hc/en-us/articles/214991667-Read-time\" target=\"_blank\">read time forumula</a>.</em>\n</p>\n\n\n## \ud83e\uddee Algorithm\n\nMedium's Help Center says,\n\n> 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.\n\n[Source](https://help.medium.com/hc/en-us/articles/214991667-Read-time)\n\nDouble checking with real articles, the English algorithm is:\n\n seconds = num_words / 265 * 60 + img_weight * num_images\n\nWith `img_weight` starting at `12` and decreasing one second with each image encountered, with a minium `img_weight` of `3` seconds.\n\n\n## Requirements\n\nMacOS or Linux\n\nPython 3.9+\n\nReadtime-CLI stands on the shouders of giants:\n\n* [Typer](https://github.com/tiangolo/typer)\n* [Readtime](https://github.com/alanhamlett/readtime)\n\n\n## \ud83d\udee0 Installation\n\n### Poetry\n\n poetry add readtime-cli\n\n### Pip\n\n virtualenv venv\n . venv/bin/activate\n pip install readtime-cli\n\n\n## \ud83d\udcbb Usage\n\n\n### Version\n\n```sh\nreadtime version\n```\n\n### Calculate Read time Markdown files\n\n```sh\nreadtime md FILE_PATH [OPTIONS]\n```\n\n### Calculate Read time HTML files\n\n```sh\nreadtime html FILE_PATH [OPTIONS]\n```\n\n### Calculate Read time Text files\n\n```sh\nreadtime text FILE_PATH [OPTIONS]\n```\n\n### Options for all commands\n\n --wpm INTEGER Word Per Minute [default: 265]\n --language [en|pt-br] [default: Languages.en]\n --help Show this message and exit.\n\n",
"bugtrack_url": null,
"license": "",
"summary": "CLI to calculates the time some text takes the average human to read, based on Medium's read time forumula.",
"version": "0.2.3",
"split_keywords": [
"python",
"readtime",
"readtime_cli",
"cli"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "a4ab7b5341c4111e7d08c86b3d3ca02e8f11ea643c817764adb43930eead38e6",
"md5": "f31ef7e7a57f188872465f3c56881488",
"sha256": "1c06d6514e0d95f7047aecb4b517868a12ab6cec3f324f8ce37f5ba393f6bfea"
},
"downloads": -1,
"filename": "readtime_cli-0.2.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "f31ef7e7a57f188872465f3c56881488",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8,<3.11",
"size": 3580,
"upload_time": "2023-02-02T02:12:10",
"upload_time_iso_8601": "2023-02-02T02:12:10.304368Z",
"url": "https://files.pythonhosted.org/packages/a4/ab/7b5341c4111e7d08c86b3d3ca02e8f11ea643c817764adb43930eead38e6/readtime_cli-0.2.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "0fa188dd6394eadd1b7f902f8ec7ae132aa4b2a0931655e375c333bbc6c6a3b9",
"md5": "f99b9a9fd9902fc6c5d331efa005ed8d",
"sha256": "b3ef3bc664a1944f262ed3077231ff8b973e548cc489c88f575eb890f680ff62"
},
"downloads": -1,
"filename": "readtime_cli-0.2.3.tar.gz",
"has_sig": false,
"md5_digest": "f99b9a9fd9902fc6c5d331efa005ed8d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8,<3.11",
"size": 3349,
"upload_time": "2023-02-02T02:12:11",
"upload_time_iso_8601": "2023-02-02T02:12:11.348018Z",
"url": "https://files.pythonhosted.org/packages/0f/a1/88dd6394eadd1b7f902f8ec7ae132aa4b2a0931655e375c333bbc6c6a3b9/readtime_cli-0.2.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-02-02 02:12:11",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "guedesfelipe",
"github_project": "readtime_cli",
"travis_ci": false,
"coveralls": true,
"github_actions": true,
"lcname": "readtime-cli"
}