Ravenports generated: 24 Jan 2024 01:51
[ravenports.git] / bucket_62 / python-readtime
1 # Buildsheet autogenerated by ravenadm tool -- Do not edit.
2
3 NAMEBASE=               python-readtime
4 VERSION=                3.0.0
5 KEYWORDS=               python
6 VARIANTS=               v11 v12
7 SDESC[v11]=             Texing reading time calculator (3.11)
8 SDESC[v12]=             Texing reading time calculator (3.12)
9 HOMEPAGE=               https://github.com/alanhamlett/readtime
10 CONTACT=                Python_Automaton[python@ironwolf.systems]
11
12 DOWNLOAD_GROUPS=        main
13 SITES[main]=            PYPI/r/readtime
14 DISTFILE[1]=            readtime-3.0.0.tar.gz:main
15 DF_INDEX=               1
16 SPKGS[v11]=             single
17 SPKGS[v12]=             single
18
19 OPTIONS_AVAILABLE=      PY311 PY312
20 OPTIONS_STANDARD=       none
21 VOPTS[v11]=             PY311=ON PY312=OFF
22 VOPTS[v12]=             PY311=OFF PY312=ON
23
24 DISTNAME=               readtime-3.0.0
25
26 GENERATED=              yes
27
28 [PY311].BUILDRUN_DEPENDS_ON=            python-beautifulsoup4:single:v11
29                                         python-markdown2:single:v11
30                                         python-pyquery:single:v11
31 [PY311].USES_ON=                        python:v11,sutools
32
33 [PY312].BUILDRUN_DEPENDS_ON=            python-beautifulsoup4:single:v12
34                                         python-markdown2:single:v12
35                                         python-pyquery:single:v12
36 [PY312].USES_ON=                        python:v12,sutools
37
38 [FILE:2023:descriptions/desc.single]
39 # readtime
40
41 [Tests]
42 [Coverage]
43
44 Calculates the time some text takes the average human to read, based on
45 Medium's [read time forumula].
46
47 ### Algorithm
48
49 Medium's Help Center says,
50
51 > Read time is based on the average reading speed of an adult (roughly 265
52 WPM). We take the total word count of a post and translate it into minutes,
53 with an adjustment made for images. For posts in Chinese, Japanese and
54 Korean, it's a function of number of characters (500 characters/min) with
55 an adjustment made for images.
56
57 Source: https://help.medium.com/hc/en-us/articles/214991667-Read-time (Read
58 Sept 23rd, 2018)
59
60 Double checking with real articles, the English algorithm is:
61
62     seconds = num_words / 265 * 60 + img_weight * num_images
63
64 With `img_weight` starting at `12` and decreasing one second with each
65 image encountered, with a minium `img_weight` of `3` seconds.
66
67 ### Installation
68
69     virtualenv venv
70     . venv/bin/activate
71     pip install readtime
72
73 Or if you like to live dangerously:
74
75     sudo pip install readtime
76
77 ### Usage
78
79 Import `readtime` and pass it some text, HTML, or Markdown to get back the
80 time it takes to read:
81
82     >>> import readtime
83     >>> result = readtime.of_text('The shortest blog post in the world!')
84     >>> result.seconds
85     2
86     >>> result.text
87     u'1 min'
88
89 The result can also be used as a string:
90
91     >>> str(readtime.of_text('The shortest blog post in the world!'))
92     u'1 min read'
93
94 To calculate read time of Markdown:
95
96     >>> readtime.of_markdown('This is **Markdown**')
97     1 min read
98
99 To calculate read time of HTML:
100
101     >>> readtime.of_html('This is <strong>HTML</strong>')
102     1 min read
103
104 To customize the WPM (default 265):
105
106     >>> result = readtime.of_text('The shortest blog post in the world!',
107 wpm=5)
108     >>> result.seconds
109     96
110     >>> result.text
111     u'2 min'
112     >>> result.wpm
113     5
114
115 ### Contributing
116
117 Before contributing a pull request, make sure tests pass:
118
119     virtualenv venv
120     . venv/bin/activate
121     pip install tox
122     tox
123
124 Many thanks to all [contributors]!
125
126
127 [FILE:100:distinfo]
128 76c5a0d773ad49858c53b42ba3a942f62fbe20cc8c6f07875797ac7dc30963a9         6271 readtime-3.0.0.tar.gz
129