PHPackages                             sportlog/fit - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. sportlog/fit

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

sportlog/fit
============

A decoder for FIT files

v0.6.0(2mo ago)118.5k↓45.7%5[1 PRs](https://github.com/sportlog/fit/pulls)MITPHPPHP &gt;=8.0CI passing

Since Feb 6Pushed 2mo ago2 watchersCompare

[ Source](https://github.com/sportlog/fit)[ Packagist](https://packagist.org/packages/sportlog/fit)[ RSS](/packages/sportlog-fit/feed)WikiDiscussions main Synced 3d ago

READMEChangelogDependencies (8)Versions (25)Used By (0)

FIT
===

[](#fit)

A PHP (&gt;= PHP 8) decoder for FIT files created by Garmin devices. The result is a list of all messages decoded from the file. Each message is an instance of its underlying message class, so you can easily access any (native) fields using intellisense. (FIT SDK 21.201)

Install via Composer
--------------------

[](#install-via-composer)

You can install sportlog/FIT using Composer.

```
$ composer require sportlog/fit
```

Minimum PHP version required is 8.

There are two functions for decoding

- read: requires the file as parameter and returns an instance of MessageList, which holds all decoded messages.
- stream: requires the file and a callback as parameter, which receives each decoded message. Returns void to reduce memory consumption.

How to use
----------

[](#how-to-use)

```
