Let's Put It All Together - Second Edition

This notebook marks a bit of a milestone, as it brings together a lot of code that I added to the notebook over the last couple of days. In a previous post with a similar title I had finished charting all the data from the NutriSense export, and in this post, I finished charting all data from NutriSense plus my sleep data as well as Garmin run and step data.

A minor change in this notebook is that you don’t have to put your Garmin Connect userID and password into the notebook anymore. Putting this kind of data into the notebook is not great because if you end up sharing the notebook with others, you may accidentally share your Garmin Connect login credentials. To avoid this, the notebook now reads the credentials from file called config.dat, located in the same directory as the notebook and the NuitriSense data export. The file should look like this:

1uid = GarminConnectUserName
2password = GarminConnectPassword

Another change compared to the notebook I shared a few days ago is that the formatting of the labels for meals and activities has improved, and should be less prone to overlapping. The text still doesn’t work well with long descriptions, but it has improved. I have also added code that explicitly sets the size of the plotly chart. This may not work well for smaller screens, but it makes to chart much more readable.

Chart with Events

The chart above shows nicely how the Garmin step data can be used to infer when I take walks and don’t record them in the NutriSense app. I recorded a 20 minute walk in the NutriSense app around 16:30, and it is shown in green in the chart. Looking at the step data, one can see that the 20 minute walk shows up as 2 bars, one slightly above 1500 steps and and another at roughly 600 steps. If I use this as the signature for a walk, then it looks like I also did a brief walk at 12:00 and at 15:00.

The chart also shows that running at a reasonably fast pace produces a bit more than 2,500 steps every 15 minutes, as seen by the 7K (or 4.5 mile) run I did around 9:00.

All the notebooks are available from my Github repository and here is a direct download link for just this notebook.