Skip to main content

Garmin Connect download and analysis

Project description

Screen shot of a daily graph


Screen shot of an activity display


Screen shot of daily trend

GarminDB

Python scripts for parsing health data into and manipulating data in a SQLite database. SQLite is a light weight database that doesn't require a server.

What they can do:

  • Automatically download and import Garmin daily monitoring files (all day heart rate, activity, climb/descend, stress, and intensity minutes) from the user's Garmin Connect "Daily Summary" page.
  • Extract sleep, weight, and resting heart rate data from Garmin Connect, store it as JSON files, and import it into the DB.
  • Download and import activity files from Garmin Connect. A summary table for all activities and more detailed data for some activity types. Lap and record entries for activities.
  • Summarizing data into a DB with tables containing daily, weekly, monthly, and yearly summaries.
  • Graph your data from the commandline or with Jupyter notebooks.
  • Retain downloaded JSON and FIT files so that the DB can be regenerated without connecting to or redownloading data from Garmin Connect.
  • Export activities as TCX files.

Once you have your data in the DB, I recommend using a supplied Jupyter notebooks, third party Jupyter notebooks, and/or SQLite browser like SQLite Studio, HeidiSQL, or DB Browser for SQLite for browsing and working with the data. The scripts create some default views in the DBs that make browsing the data easier.

Using It

Releases

GarminDb releases are hosted on PyPI. GarminDb requires Python 3.x. With Python installed, install the latest release with pip by running pip install garmindb in a terminal.

  • Copy GarminConnectConfig.json.example to ~/.GarminDb/GarminConnectConfig.json, edit it, and add your Garmin Connect username and password and adjust the start dates to match the dates of your data in Garmin Connect.
  • Starting out: download all of your data and create your db by running garmindb_cli.py --all --download --import --analyze in a terminal.
  • Incrementally update your db by downloading the latest data and importing it by running garmindb_cli.py --all --download --import --analyze --latest in a terminal.
  • Ocassionally run garmindb_cli.py --backup to backup your DB files.

Update to the latest release with pip install --upgrade garmindb.

From Source

The scripts are automated with Make. Run the Make commands in a terminal window.

  • Git clone GarminDB repo using the SSH clone method. The submodules require you to use SSH and not HTTPS. Get the command from the green button on the project home page.
  • Run make setup in the cloned tree to get the scripts ready to process data.
  • Copy GarminConnectConfig.json.example to ~/.GarminDb/GarminConnectConfig.json, edit it, and add your Garmin Connect username and password and adjust the start dates to match the dates of your data in Garmin Connect.
  • Run make create_dbs once to fetch and process for you data.
  • Keep all of your local data up to date by periodically running only one command: make.

There is more help on using the program in the wiki.

Jupyter Notebooks

Jupyter notebooks for analzing data from the database can be found in the 'Jupyter' directory in the source tree. Links to user submitted notebooks can be found in the wiki.

Plugins

Plugins allow the user to expand the types of data that are processed and stored in the database. GarminDb already has a number of plugins for handling data from third-party Connect IQ apps and data fields. Read more about plugins here.

Support This Project

Do you find this project useful? Buy Me A Coffee

Success Stories

Find out who's using GarminDb on what platforms, OSes, and python versions here. If you're using GarminDB and your scenario isn't listed send me a message or file an issue with your success case.

Notes

  • You may get a DB version exception after updating the code, this means that the DB schema was updated and you need to rebuild your DBs by running garmindb_cli.py --rebuild_db. Your DBs will be regenerated from the previously downloaded data files. All of your data will not be redownloaded from Garmin.
  • The scripts were developed on MacOS. Information or patches on using these scripts on other platforms are welcome.
  • When a database update finishes, a summary of the data in the DB will be saved to stats.txt. The output includes the date ranges included in the downloaded daily monitoring files and activities. It includes the number of records for daily monitoring, activities, sleep, resting heart rate, weight, etc. Use the summary information to determine if all of your data has been downloaded from Garmin Connect. If not, adjust the dates in GarminConnectConfig.json and runt he download again.
  • In GarminConnectConfig.json the "steps" element of the "course_views" is list of course ids that per course database views will be generated for. The database view allows you to compare all activities from that course.

Bugs and Debugging

  • If you have issues, file a bug here on the project. See the Issues tab at the top of the project page. Run make bugreport or garmindb_bug_report.py and include bugreport.txt in your bug report.
  • Besides errors that appear on the screen, one of the first places to look for more information is the log files (garmindb.log).
  • If you're having issues with a particular data files, please considering sharing so I can debug it and add support.

Contributing

Please submit a pull request targeting the develop branch and add your self to the contributors file. Run make flake8 at the top level and fix all errors before submitting your pull request.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

garmindb-3.6.7.tar.gz (81.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

garmindb-3.6.7-py3-none-any.whl (87.7 kB view details)

Uploaded Python 3

File details

Details for the file garmindb-3.6.7.tar.gz.

File metadata

  • Download URL: garmindb-3.6.7.tar.gz
  • Upload date:
  • Size: 81.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for garmindb-3.6.7.tar.gz
Algorithm Hash digest
SHA256 4a8491fb522b7b977e915f9ec60273c9097a018a588c5396b7d4d1cb4922624a
MD5 c1da69034f00ebd003b078ff9f4f87c6
BLAKE2b-256 e284d500740f6ce2c84ac785acb2c13b50cfed3b977c858acfa3b515c239b43d

See more details on using hashes here.

File details

Details for the file garmindb-3.6.7-py3-none-any.whl.

File metadata

  • Download URL: garmindb-3.6.7-py3-none-any.whl
  • Upload date:
  • Size: 87.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.9

File hashes

Hashes for garmindb-3.6.7-py3-none-any.whl
Algorithm Hash digest
SHA256 262d4cdda8ccd5e5e57d8586e6f0eb87661e01508b382b4b1a671d4cc64e2b96
MD5 ce7c45fbf493da26a0331c415da7107e
BLAKE2b-256 c3568ce46354b8a95238015127f079877bcfe7ab6db46d3c1518a1168eadabcf

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page