FitAPI.jl is a Julia package for reading Garmin FIT files with a type-stable core parser and an ergonomic high-level analysis API.
- Fast low-level parsing via
parsefitandeachmessage - High-level semantic decode via
readfit - Table-friendly output via
to_table(Tables.jl compatible) - Unknown and developer fields preserved for exploratory workflows
- Optional CRC validation and strict format checks
From a local checkout:
using Pkg
Pkg.activate(".")
Pkg.instantiate()From another Julia environment pointing to this path:
using Pkg
Pkg.add(path="/absolute/path/to/FitAPI.jl")using FitAPI
# High-level parse + semantic decode
fit = readfit("data/sdk/Activity.fit")
# Pull record messages and inspect decoded profile-backed fields
record = first(messages(fit; name=:record))
fieldvalue(record, :distance)
# Convert to a table-like vector of NamedTuple
rows = to_table(fit; message=:record, extras_policy=:wide)
first(rows)parsefit(path_or_io; options=ParserOptions())eachmessage(path_or_io; options=ParserOptions())readfit(path_or_io; options=ParserOptions(), decode=DecodeOptions())messages(fitobj, ::Type{T})messages(fitobj; name::Symbol)fieldvalue(msg, name)/fieldraw(msg, name)to_table(fitobj; message=:record, extras_policy=:wide)
Run tests:
julia --project=. -e 'using Pkg; Pkg.test()'Run benchmarks:
julia --project=. benchmark/bench_parse.jl
julia --project=. benchmark/bench_allocations.jl