Shared FIT file generation library for AmakaFlow
Project description
AmakaFlow FIT File Tool
Single source of truth for Garmin FIT file generation and exercise mapping.
Installation
# From the amakaflow-dev-workspace directory
pip install -e ./amakaflow-fitfiletool
# Or from git (when published)
pip install git+https://github.com/yourorg/amakaflow-fitfiletool.git
Usage
Exercise Lookup
from amakaflow_fitfiletool import GarminExerciseLookup
lookup = GarminExerciseLookup()
result = lookup.find("DB Bench Press")
# Returns: {"category_id": 0, "category_name": "Bench Press", "display_name": "Bench Press", ...}
Build FIT File
from amakaflow_fitfiletool import build_fit_workout
workout = {
"title": "My Workout",
"blocks": [{
"exercises": [
{"name": "Push Ups", "reps": 10, "sets": 3},
{"name": "Squats", "reps": 15, "sets": 3}
],
"rest_between_sec": 30
}]
}
fit_bytes = build_fit_workout(workout)
with open("workout.fit", "wb") as f:
f.write(fit_bytes)
Get Preview Steps (for UI)
from amakaflow_fitfiletool import get_preview_steps
steps = get_preview_steps(workout, use_lap_button=False)
# Returns list of steps exactly as they will appear on the watch
Get Metadata
from amakaflow_fitfiletool import get_fit_metadata
metadata = get_fit_metadata(workout)
# Returns: {"detected_sport": "strength", "exercise_count": 2, ...}
Features
- Valid FIT SDK Categories: Only uses categories 0-32 (extended categories 33+ are remapped)
- Smart Exercise Mapping: Built-in keywords for common exercises (run, ski erg, rower, etc.)
- Sport Type Detection: Automatically detects strength vs cardio vs running
- Lap Button Support: Option to use lap button press instead of reps/distance
- Preview Sync: Preview steps match exactly what gets exported
Category Remapping
Invalid FIT SDK categories (33+) are automatically remapped:
- Categories 33-38 → Cardio (2)
- Categories 39-43 → Total Body (29)
- Any other invalid → Total Body (29)
This ensures workouts are accepted by all Garmin watches.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file amakaflow_fitfiletool-0.2.3.tar.gz.
File metadata
- Download URL: amakaflow_fitfiletool-0.2.3.tar.gz
- Upload date:
- Size: 58.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6f6412186ab9f3759085a3896251562fe070d49f4f9cc0c106d547dbb1623db4
|
|
| MD5 |
deda28772bdd5df450312c01b5e24933
|
|
| BLAKE2b-256 |
125cdaedf1c995cdb93725123816f0c9ba438f05dbb83ffb1498f55e2e4e625c
|
File details
Details for the file amakaflow_fitfiletool-0.2.3-py3-none-any.whl.
File metadata
- Download URL: amakaflow_fitfiletool-0.2.3-py3-none-any.whl
- Upload date:
- Size: 59.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8ebd417dcfa4cb0df7509ad696255a618b0c75eb204d075627b6be94f4ddc22c
|
|
| MD5 |
fa3f1df3d6c70e772675070bf8762f9e
|
|
| BLAKE2b-256 |
69e763097d0d2602ed87dacf9f43bfa7c0aca35fa3a7e4e13d365bcad8f0e0d0
|