Skip to content

DA04/fitness_tracker_data_parsing

 
 

Repository files navigation

FIT files parsing

I have detailed tutorial article published in Russian here https://habr.com/ru/post/658675/

Changes to parse_fit.py file

There are few changes from the original parse_fit.py file:

  1. get_dataframes() function has been extended from Record and Lap dataframes to Record, Lap, Activity, Session, File_ID messages. They are main messages in FIT file according to Garmin docs
  2. get_fit_other_data() function added to extract the data from other FIT frames (file_id, session and activity). It copies the functionality of original get_fit_lap_data() and get_fit_point_data() functions.
  3. Extenstion for the attributes list from the Record message (distance, cadence, power and temperature) added. The Points reference from the original script is replaced with Record to align with established messages names.
  4. New function load_dataframe_to_postgres() added in order to load parsed dataframes content to postgres tables.
  5. Loop added to go through all the fit files in the directory. The files with the error will be printed out in errors list.

Postgres Schema

Postgres Schema for Record, Lap, Activity, Session and File_ID tables can be restored via the backup file. Generated ERD schema can be found here: ERD

Summary chart for the trainings

I have created a stacked bar chart to check if loaded data is full enough. The python script based on matplotlib is available in summary_chart.py Summary_chart

About

Repo for parsing FIT files

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%