A Python Progress Tracker for Kindle

python matplotlib books

Is our reading pace consistent throughout a book? Or are there parts where we speed up and parts where we slow down? Here is a mini Python hack to investigate that using Amazon’s kindle.

The final results are graphs that help you answer:

sample run on my clippings from Stoker's 'Dracula'

This should have been slightly easier. Unfortunately, Amazon doesn’t allow you to write custom apps for your own Kindle. Which means that the only way to add this feature was jailbreak my small little device and possibly risk bricking it. Reluctant to try that path first, I decide to look for alternatives.

The result was a Python script that does the plotting for you (screenshot above). Once the kindle is connected, a bash script gets the My Clippings.txt file from your Kindle. The python script then takes this file, uses some regular expressions to locate the required timestamps, and finally uses these times stamps to plot your progress through a book [1].

The script has been refactored and now hides resides here [2]. One thing though, this only works if you consistently take notes on your kindle, highight stuff, or bookmark things.

[1]I guess the project is simple enough to be implemented in JavaScript and I should try porting it to use d3.
[2]It’s quite sad; ebook_utils was the best name I could come up with.