When Garmin Connect is not enough

2 minute read

Published:

What is this? Another scraper?

First off, as simple as possible: pygce is a python script to download and analyze your data from your Garmin Connect dashboard.

  • it’s not a simple scraper, because it’s also a bot which handles webpage stuff
  • it’s not a common machine-learning program, because it provides all the tools to retrieve the dataset
  • it’s not an illegal data-fetcher/russian virus parser, because it’s the user only who provides the credentials and run the script
  • it’s not a bot, since it provides also APIs and models to deal with common Garmin Connect features

Why bother with using this when Garmin Connect has export feature?

Many reasons, top 3 are:

  • the export feature only works with some data fields provided by Garmin: e.g you cannot export your deep sleep data
  • Garmin Connect does not provide any (mathematical, statistical, machine-learn-style) insight into your data
  • I want to mechanize the process of saving all my data (Garmin Connect has no such a feature download all your data)

Behold the power of machine learning!

Yes, it’s very powerful indeed: so why can’t a (very scrupulous user) have some (deep and powerful) guidelines on how to improve one’s training? Ok, Garmin lets you see how well you perform against the average user your age, but does it let you see the correlation between the hours of deep sleep and the average pace in a > 10 km run? And that’s important, very.

Yeah, understood, you created something good, now? What can we do with it?

I hope the repository guide is self-explanatory, but essentially what you do is

mkdir github-projects && cd github-projects  # create tmp directory
git clone https://github.com/sirfoga/pygce.git  # or wget https://github.com/sirfoga/pygce/archive/master.zip
cd pygce  # enter local repo
pip3 install . --upgrade --force-reinstall  # install
usage: -u <username (email) to login to Garmin Connect> -p <password to login to Garmin Connect> -c <path to chromedriver to use> -d <days to save. e.g -d 2017-12-30 or -d 2016-01-01 2017-12-30> -f <format of output file [json, csv]> -o <path to output file>

optional arguments:
  -h, --help            show this help message and exit
  -user                 username (email) to login to Garmin Connect
  -password             password to login to Garmin Connect
  -url URL              url to connect to (e.g https://connect.garmin.com)
  -chrome               path to chromedriver to use
  -d [DAYS [DAYS ...]]  days to save. e.g -d 2017-12-30 or -d 2016-01-01 2017-12-30
  -gpx                  download .gpx files too [y/n]
  -out                  path to output file

Stuff todo