All Projects → alanhamlett → readtime

alanhamlett / readtime

Licence: other
Calculates the time some text takes the average human to read, based on Medium's read time forumula.

Programming Languages

python
139335 projects - #7 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to readtime

indices
Indices creates a Table of Contents sidebar for Medium articles, and enables you to skip around
Stars: ✭ 16 (-82.8%)
Mutual labels:  medium
medium-sdk-elixir
Elixir SDK for the Medium.com API. 🌐
Stars: ✭ 19 (-79.57%)
Mutual labels:  medium
artigo-solid-medium
Implementações dos exemplos demonstrados no artigo: https://bit.ly/2o97vY1
Stars: ✭ 28 (-69.89%)
Mutual labels:  medium
medium-to-markdown
Converts Medium posts to markdown.
Stars: ✭ 68 (-26.88%)
Mutual labels:  medium
hosts
自动生成 Hosts 文件,科学上网
Stars: ✭ 30 (-67.74%)
Mutual labels:  medium
MediumAppFlutter
Flutter recreation of the UI of the Medium android app
Stars: ✭ 62 (-33.33%)
Mutual labels:  medium
medium
Usando a api do medium pra ler artigos e exibir o html
Stars: ✭ 33 (-64.52%)
Mutual labels:  medium
code-medium
Browser extension that simplifies writing code in Medium posts. Quickly create and edit Github Gists without leaving the editor
Stars: ✭ 59 (-36.56%)
Mutual labels:  medium
blog-template
Template for the Jekyll-powered elementary blog
Stars: ✭ 34 (-63.44%)
Mutual labels:  medium
kuote
Create beautiful Medium-like quotes, perfect for sharing on Twitter or Instagram.
Stars: ✭ 11 (-88.17%)
Mutual labels:  medium
rawr
Extract raw R code directly from webpages, including Github, Kaggle, Stack Overflow, and sites made using Blogdown.
Stars: ✭ 15 (-83.87%)
Mutual labels:  medium
github-readme-medium
📖 Dynamically generated your latest Medium article on your GitHub readmes!
Stars: ✭ 56 (-39.78%)
Mutual labels:  medium
FlutterMediumClone
Building a Medium Clone in Flutter.
Stars: ✭ 55 (-40.86%)
Mutual labels:  medium
static-medium-isr-in-nuxtjs-with-layer0
Demo showing off ISR in Nuxt.js with Layer0
Stars: ✭ 36 (-61.29%)
Mutual labels:  medium
Medium-Python-Neural-Network
This code is part of my post on Medium.
Stars: ✭ 58 (-37.63%)
Mutual labels:  medium
Articles-Bookmarked
No description or website provided.
Stars: ✭ 30 (-67.74%)
Mutual labels:  medium
Self-Driving-Car-Steering-Simulator
The aim of this project is to allow a self driving car to steer autonomously in a virtual environment.
Stars: ✭ 15 (-83.87%)
Mutual labels:  medium
read-medium-extension
Chrome extension for reading Medium for free without leaving the page.
Stars: ✭ 55 (-40.86%)
Mutual labels:  medium
React-Medium-Blog
React blog page which consist of last ten medium posts. The blog card is created using shards React and React application.
Stars: ✭ 14 (-84.95%)
Mutual labels:  medium
webpack-2.0-from-scratch
Guide on how to setup a Webpack config from scratch.
Stars: ✭ 72 (-22.58%)
Mutual labels:  medium

readtime

Tests Coverage

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.

Source: https://help.medium.com/hc/en-us/articles/214991667-Read-time (Read Sept 23rd, 2018)

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.

Installation

virtualenv venv
. venv/bin/activate
pip install readtime

Or if you like to live dangerously:

sudo pip install readtime

Usage

Import readtime and pass it some text, HTML, or Markdown to get back the time it takes to read:

>>> import readtime
>>> result = readtime.of_text('The shortest blog post in the world!')
>>> result.seconds
2
>>> result.text
u'1 min'

The result can also be used as a string:

>>> str(readtime.of_text('The shortest blog post in the world!'))
u'1 min read'

To calculate read time of Markdown:

>>> readtime.of_markdown('This is **Markdown**')
1 min read

To calculate read time of HTML:

>>> readtime.of_html('This is <strong>HTML</strong>')
1 min read

To customize the WPM (default 265):

>>> result = readtime.of_text('The shortest blog post in the world!', wpm=5)
>>> result.seconds
96
>>> result.text
u'2 min'
>>> result.wpm
5

Contributing

Before contributing a pull request, make sure tests pass:

virtualenv venv
. venv/bin/activate
pip install tox
tox

Many thanks to all contributors!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].