Skip to main content

Parse Garmin .fit wellness data, process it, and make DataFrame and NumPy arrays

Project description

fitparserx library

A lightweight Python library for parsing Garmin .fit files and extracting wellness data (heart rate, stress level, respiration rate) into convenient Python structures (pandas DataFrame, NumPy array). These data are sourced from Garmin Wellness exports: either the daily export (Account Settings > Account Information > Export Wellness Data) or the full archive emailed via the Data Management page. Support for Garmin activity data will be added in a future release.

Features

Uses Garmin .fit files decoded with the garmin_fit_sdk to:

  • Extract proper datetimes and heart rate data.
  • Optionally include respiration rate and stress level data.
  • Converts the raw data into a pandas DataFrame or a NumPy array.
  • Timezone‑aware datetime handling.

Installation (Linux)

  1. Clone this repository (or copy fitparserx.py into your project):
  git clone https://github.com/YourUserName/my-library.git
  cd my_library
  1. (Optional) Create and activate a virtual environment:
python3 -m venv venv
source venv/bin/activate
  1. Install dependencies:
pip install garmin_fit_sdk numpy pandas pytz

Usage

from fitparserx import FitParser

Initialize parser pointing to a directory or single file

Put your data into a data/ file. Otherwise, the parser goes through data in the current working directory. You can also point a path to a specific file.

mode='all' requires email prefix for .fit filenames

parser = FitParser(path="./data", email="user@example.com", mode="all")

DataFrame

Convert to a pandas DataFrame with datetimes and metrics:

# Only heart rate (default)
df = parser.to_dataframe()

# Include stress level and respiration rate, fill missing with NaN
df2 = parser.to_dataframe(add_metrics=["stress_level", "respiration_rate"], timezone="UTC")

NumPy Array

df = parser.to_numpy()

License

MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fitparserx-0.1.0.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fitparserx-0.1.0-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

Details for the file fitparserx-0.1.0.tar.gz.

File metadata

  • Download URL: fitparserx-0.1.0.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for fitparserx-0.1.0.tar.gz
Algorithm Hash digest
SHA256 071dc97fe81e864c8b38ef6d5fd70a5b90769a47fa68b14e71731573527497b4
MD5 8c024e3ab81ccb4b499909666731b516
BLAKE2b-256 347b682a28a72751caa8f05dcb385c4a3142c0b19e20e000e6ea0c60d14fe67a

See more details on using hashes here.

File details

Details for the file fitparserx-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: fitparserx-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for fitparserx-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 28d8296e51d8951ef018d0663469b8f6cd11d01e948034ebd91b0a2362bdbee8
MD5 6a1133fc6fbb0e1ff9ce898431402168
BLAKE2b-256 99e5d46c8e2f476021fe1fcea629023711208f3409f8d8d0c5d4323755427181

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page