NOTE: This is a fork of dtcooper/python-fitparse. The original maintainer has limited time to work on this package. This fork continues active development with support for new FIT SDK versions and patches.
Here's a Python library to parse ANT/Garmin .FIT files.
pip install python-fitparse
A simple example of printing records from a fit file:
import fitparse
# Load the FIT file
fitfile = fitparse.FitFile("my_activity.fit")
# Iterate over all messages of type "record"
# (other types include "device_info", "file_creator", "event", etc)
for record in fitfile.get_messages("record"):
# Records can contain multiple pieces of data (ex: timestamp, latitude, longitude, etc)
for data in record:
# Print the name and value of the data (and the units if it has any)
if data.units:
print(" * {}: {} ({})".format(data.name, data.value, data.units))
else:
print(" * {}: {}".format(data.name, data.value))
print("---")The library also provides a fitdump command-line tool for parsing FIT files. Run fitdump --help for details.
This project is licensed under the MIT License - see the LICENSE
file for details.