Garmin FIT Python SDK

raw JSON →
21.202.0 verified Fri May 01 auth: no python

A Python library for reading and writing FIT (Flexible and Interoperable Data Transfer) files, widely used in Garmin devices and fitness applications. The SDK provides classes to decode FIT files into messages and fields, and to encode custom FIT files. Current version is 21.202.0, with a release cadence that follows Garmin's FIT SDK releases (usually quarterly).

pip install garmin-fit-sdk
error ModuleNotFoundError: No module named 'garmin_fit'
cause Incorrect import path. The module is 'garmin_fit_sdk' (with 'sdk').
fix
Use 'from garmin_fit_sdk import Decode'.
error AttributeError: 'Decode' object has no attribute 'read'
cause Using a very old version of the SDK (pre-21.x). The API changed.
fix
Install latest version (>=21) and use decoder.read(stream).
error TypeError: cannot unpack non-iterable Decode object
cause Calling decode() without tuple unpacking, but the method returns (messages, errors).
fix
Use messages, errors = decoder.read(stream).
breaking The decode method returns a tuple (messages, errors). In older versions (<21.120.0) it returned just messages. Check that your code unpacks correctly.
fix Update to newest version and use messages, errors = decoder.read(stream).
deprecated datetime.utcfromtimestamp is no longer used; replaced by datetime.fromtimestamp with UTC. This may affect timezone-naive timestamps in older code.
fix Upgrade to >=21.178.0.
gotcha The Stream object must be created before Decode. Passing a file path directly to Decode will fail.
fix Always use Stream.from_file() or Stream.from_bytes().
gotcha The Encoder class was added in v21.200.0. Attempting to import Encoder in older versions will raise ImportError.
fix Check version or update to >=21.200.0 if you need encoding.

Basic usage: decode a FIT file and iterate over messages. No authentication needed.

from garmin_fit_sdk import Decode, Stream

# Decode a FIT file
file_path = 'example.fit'
stream = Stream.from_file(file_path)
decoder = Decode()
messages, errors = decoder.read(stream)

print(f"Decoded {len(messages)} messages, errors: {errors}")

# Print some sample data
for msg in messages[:5]:
    print(msg.name)
    for field in msg: