Almad / GarminDB

Python scripts for parsing Garmin Fit, FitBit CSV, and MS Health CSV files into and manipulating data in Sqlite DBs.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Screen shot of browsing the DB

GarminDB

Python scripts for parsing health data into and manipulating data in a SQLite DB. SQLite is a light weight DB that requires no server.

What they can do:

  • Automatically download and import Garmin daily monitoring files (all day heart rate, activity, climb/decend, stress, and intensity minutes) from the user's Garmin Connect "Daily Summary" page.
  • Extract sleep, weight, and resting heart rate data from Garmin Connect 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.
  • Import Fitbit daily summary CSV files (files with one summary entry per day).
  • Import MS Health daily summary CSV files and MS Health Vault weight export CSV files.
  • Summarizing data into a common DB with tables containing daily summaries, weekly summaries, and monthly summaries.
  • Retain data as JSON files or FIT files so that the DB can be regenerated without connecting to Garmin.

Once you have your data in the DB, I recomend using a SQLite browser like SQLite Studio for browsing and working with the data.

Using It

The scripts are automated with Make. Run the Make commands in a terminal window. You may need to reconfigure the file and directory paths in the makefile variables.

  • Git clone GarminDB repo. Get the command from the green button on the project home page.
  • Run make setup get the scripts ready to process data.
  • Run make GC_DATE=<date to start downloading data from> GC_DAYS={number of days of data to download} GC_USER={username} GC_PASSWORD={password} build_dbs.
  • Keep all of your local data up to date by running only one command: make GC_USER={username} GC_PASSWORD={password}.
  • Run make backup to backup your DBs.

More usage

Notes

  • If you get a DB version exception, the DB schema was updated and you need to rebuild your DBs by running make GC_USER={username} GC_PASSWORD={password} rebuild_dbs.
  • The scripts were developed on OSX. Information or patches that on using these scripts on other platforms are welcome.
  • Running the scripts on Linux should require little or no changes.
  • I'm not sure what it would take to run these scripts on Windows. Installing the Ubuntu subsystem on Windows 10 is one possibility. Using a Linux container is another possibility.
  • If you have issues, file a bug here on the project. See the Issues tab at the top of the project page.

About

Python scripts for parsing Garmin Fit, FitBit CSV, and MS Health CSV files into and manipulating data in Sqlite DBs.

License:GNU General Public License v2.0


Languages

Language:Python 95.7%Language:Makefile 4.3%