Giter Site home page Giter Site logo

fit's Introduction

fit

The FIT protocol is used by many sport and fitness devices made by companies like Garmin, for example running watches and bike computers. fit provides an API for parsing these files for analysis or conversion.

Currently this package is a pretty low-level effort, and you'll need to be familiar with FIT to get much value from it. Specifically, the notion of the FIT "profile" is ignored entirely, so to make use of the decoded file you'll need to reference the "Profile.xls" spreadsheet in the FIT SDK.

The Fit module exports a convenient set of data types for examining FIT files, as well as some lenses for extracting specific data. It's intended that the API in the Fit module should be sufficient and convenient for most uses, but if you need access to the exact structure of the file you can use the data types in Fit.Internal.FitFile and parsers in Fit.Internal.Parse.

Example

Given a FIT file named "file.fit", here's how you could extract all of the "speed" fields from all of the "record" messages using the lenses in the Messages API. Looking at the FIT Profile.xls file, you can see that the message number for "record" is 20, and within a record the field number for "speed" is 6. In a GHCi session:

Right fit <- readFileMessages "file.fit"
let speeds = fit ^.. message 20 . field 6 . int

Now speeds :: [Int] is a list of the speed recordings from your activity.

fit's People

Contributors

mgiles avatar adarqui avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.