Skip to main content

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


Download files

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

Source Distribution

amakaflow_fitfiletool-0.2.3.tar.gz (58.4 kB view details)

Uploaded Source

Built Distribution

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

amakaflow_fitfiletool-0.2.3-py3-none-any.whl (59.0 kB view details)

Uploaded Python 3

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

Hashes for amakaflow_fitfiletool-0.2.3.tar.gz
Algorithm Hash digest
SHA256 6f6412186ab9f3759085a3896251562fe070d49f4f9cc0c106d547dbb1623db4
MD5 deda28772bdd5df450312c01b5e24933
BLAKE2b-256 125cdaedf1c995cdb93725123816f0c9ba438f05dbb83ffb1498f55e2e4e625c

See more details on using hashes here.

File details

Details for the file amakaflow_fitfiletool-0.2.3-py3-none-any.whl.

File metadata

File hashes

Hashes for amakaflow_fitfiletool-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 8ebd417dcfa4cb0df7509ad696255a618b0c75eb204d075627b6be94f4ddc22c
MD5 fa3f1df3d6c70e772675070bf8762f9e
BLAKE2b-256 69e763097d0d2602ed87dacf9f43bfa7c0aca35fa3a7e4e13d365bcad8f0e0d0

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