Creating a bespoke personal exercise tracking application with D3 and Python

chart
d3
dataviz
productivity processes
I created a bespoke personal exercise tracker!
Published

November 27, 2024

Three days a week I do morning three reps of two different bodyweight exercises1. I had been keeping a record of my reps in a spreadsheet, but I thought it would be interesting to do it so that I would have a graph that would automatically update on my website. So I decided to build my own app.

1 Earlier in the year I started to get pains in my shoulders so I changed the exercises I do to those that are not too hard on the shoulders — Australian style pull-ups using gymnast rings, and push-ups with a weighted back-pack, on push-up stands.

First I exported my existing data (from Apple Numbers) into a CSV file, then imported that using sqlite-utils from programming God Simon Willison:

sqlite-utils insert personal.db daily_exercise exercise_log_continuous.csv --csv

I then used ChatGPT to create a little python script that allows me to update the SQLite database via a web form (see the screenshot above). I then covered the web page into an app I can keep in my dock using the inbuilt mechanism to do this in Safari. So I can just click on the icon in my dock to access it.

I then created a graph using D3, and I modified my website update script to automatically update the CSV file the graph uses so that I can have an automatically updated version of the graph on my website. And here it is!