Using Python to Analyze my WhatPulse Keypress Statistics

The Python script covered in this blog post can be found on this project page. The most recent version of the program is whatpulse_viewer_v4.ipynb, available here. This program is released under the MIT license, so you are welcome to use it for your own work as well.

Note: I am not affiliated with WhatPulse (https://whatpulse.org), but I highly recommend trying out the program, which I’ve used since September 2008. You can find my online WhatPulse page here.

WhatPulse is a free program that keeps track of your keypress counts, allowing you to see how much you’ve typed over time. Since I do plenty of typing, both for work and during my personal time, I wanted to find a way to visualize my keypresses by day, hour, and weekday—and to keep track of my progress on a given day. Fortunately, Python makes it possible to perform these analyses.

The Python script that I created to analyze my WhatPulse data (available here) is released under the permissive MIT license, allowing you to use and modify the script for free. It begins by importing WhatPulse data from my personal computer’s SQLite database, along with copies of other databases from other computers/operating systems. It then uses Pandas and Plotly to consolidate and visualize this data. The notebook’s output contains additional statistics of interest, including keypress percentiles, all-time keypress counts, and an overview of recent daily and hourly keypress totals.

(Although the charts shown here are static .png files, the program also creates interactive .html charts, which allow you to see more information by hovering over individual bars and points.)

By saving this Jupyter Notebook as a Python script and instructing my computer to run the script each hour, I’m can also track how many keys I’ve pressed during the current day. It’s encouraging to watch my daily percentile increase as I pound away at the keyboard, and seeing these stats on a regular basis has probably motivated me to type even more than I did before!

Here’s what the hourly output of the .py version of the script looks like.

I also used this script to see whether my hourly keypress distributions changed after I got married. Not surprisingly, I now type a bit more during the day and a bit less late in the evening. Marriage has indeed changed me for the better!

I hope you’ll find this script useful for your own keypress analyses. If you have any questions about the script, feel free to reach out within this blog post or on GitHub!

Leave a comment