{"id":23779,"library":"garmin-fit-sdk","title":"Garmin FIT Python SDK","description":"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).","status":"active","version":"21.202.0","language":"python","source_language":"en","source_url":"https://github.com/garmin/fit-python-sdk","tags":["fit","garmin","file-format","fitness","decoder","encoder"],"install":[{"cmd":"pip install garmin-fit-sdk","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"Decode is a class, not a submodule.","wrong":"import garmin_fit_sdk.Decode","symbol":"Decode","correct":"from garmin_fit_sdk import Decode"},{"note":"","wrong":"","symbol":"Stream","correct":"from garmin_fit_sdk import Stream"},{"note":"All classes are under garmin_fit_sdk.","wrong":"from garmin_fit import Encoder","symbol":"Encoder","correct":"from garmin_fit_sdk import Encoder"}],"quickstart":{"code":"from garmin_fit_sdk import Decode, Stream\n\n# Decode a FIT file\nfile_path = 'example.fit'\nstream = Stream.from_file(file_path)\ndecoder = Decode()\nmessages, errors = decoder.read(stream)\n\nprint(f\"Decoded {len(messages)} messages, errors: {errors}\")\n\n# Print some sample data\nfor msg in messages[:5]:\n    print(msg.name)\n    for field in msg:","lang":"python","description":"Basic usage: decode a FIT file and iterate over messages. No authentication needed."},"warnings":[{"fix":"Update to newest version and use messages, errors = decoder.read(stream).","message":"The decode method returns a tuple (messages, errors). In older versions (<21.120.0) it returned just messages. Check that your code unpacks correctly.","severity":"breaking","affected_versions":"<21.120.0"},{"fix":"Upgrade to >=21.178.0.","message":"datetime.utcfromtimestamp is no longer used; replaced by datetime.fromtimestamp with UTC. This may affect timezone-naive timestamps in older code.","severity":"deprecated","affected_versions":"<=21.170.0"},{"fix":"Always use Stream.from_file() or Stream.from_bytes().","message":"The Stream object must be created before Decode. Passing a file path directly to Decode will fail.","severity":"gotcha","affected_versions":"All"},{"fix":"Check version or update to >=21.200.0 if you need encoding.","message":"The Encoder class was added in v21.200.0. Attempting to import Encoder in older versions will raise ImportError.","severity":"gotcha","affected_versions":"<21.200.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use 'from garmin_fit_sdk import Decode'.","cause":"Incorrect import path. The module is 'garmin_fit_sdk' (with 'sdk').","error":"ModuleNotFoundError: No module named 'garmin_fit'"},{"fix":"Install latest version (>=21) and use decoder.read(stream).","cause":"Using a very old version of the SDK (pre-21.x). The API changed.","error":"AttributeError: 'Decode' object has no attribute 'read'"},{"fix":"Use messages, errors = decoder.read(stream).","cause":"Calling decode() without tuple unpacking, but the method returns (messages, errors).","error":"TypeError: cannot unpack non-iterable Decode object"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}