Metadata-Version: 2.4
Name: fitparserx
Version: 0.1.1
Summary: Parse Garmin .fit wellness data, process it, and make DataFrame and NumPy arrays
Author-email: Luka Antonic <lukaantonicx@gmail.com>
License: MIT License
        
        Copyright (c) 2025 Luka Antonic lukaantonicx@gmail.com
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Description-Content-Type: text/markdown
License-File: LICENSE.md
Requires-Dist: garmin_fit_sdk
Requires-Dist: numpy
Requires-Dist: pandas
Requires-Dist: pytz
Dynamic: license-file

# 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](https://www.garmin.com/en-US/account/datamanagement/) 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

1. (Optional) Create and activate a virtual environment:
```
python3 -m venv .venv
source .venv/bin/activate
```
2. Install the package using pip:
```
pip install fitparserx
```

## 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)
fit_df = parser.to_dataframe()

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

### NumPy Array
```
fit_np = parser.to_numpy()
```

### License

MIT License
