All Projects → dtcooper → Python Fitparse

dtcooper / Python Fitparse

Licence: mit
Python library to parse ANT/Garmin .FIT files

Programming Languages

python
139335 projects - #7 most used programming language

Labels

Projects that are alternatives of or similar to Python Fitparse

taskit
A Task Runner in Bash
Stars: ✭ 35 (-93%)
Mutual labels:  ant
broom
A disk cleaning utility for developers.
Stars: ✭ 38 (-92.4%)
Mutual labels:  ant
Ant
A lightweight, feature-rich, easy-to-use and nice-looking BitTorrent Client developed by golang, angular 7, and electron.
Stars: ✭ 292 (-41.6%)
Mutual labels:  ant
stravaV10
Open source bike GPS: with Strava segments !
Stars: ✭ 34 (-93.2%)
Mutual labels:  ant
react-smart-app
Preconfiguration React + Ant Design + State Management
Stars: ✭ 13 (-97.4%)
Mutual labels:  ant
ReactAdmin
ant-design-pro +Golang restful-api admin 前后端分离 RBAC权限管理系统
Stars: ✭ 43 (-91.4%)
Mutual labels:  ant
ant-arduino
An implementation of a ANT driver for Arduino, Mbed and ESP-IDF
Stars: ✭ 69 (-86.2%)
Mutual labels:  ant
Re Editor
一个开箱即用的React富文本编辑器 🚀re-editor
Stars: ✭ 367 (-26.6%)
Mutual labels:  ant
aco-simulator
Ant Colony Optimization Simulator developed in HTML
Stars: ✭ 18 (-96.4%)
Mutual labels:  ant
Dita Ot
DITA Open Toolkit — the open-source XML publishing engine for content authored in the Darwin Information Typing Architecture.
Stars: ✭ 279 (-44.2%)
Mutual labels:  ant
umi-react-native
umi preset plugins for react-native
Stars: ✭ 54 (-89.2%)
Mutual labels:  ant
tikione-jacocoverage
NetBeans module that provides JaCoCo code coverage for Ant based Java SE, Java EE and NetBeans Module projects (JDK5,6,7,8 compatible).
Stars: ✭ 25 (-95%)
Mutual labels:  ant
SFE-Engine
A real time renderer based on Vulkan(LWJGL).
Stars: ✭ 20 (-96%)
Mutual labels:  ant
wx-ant-ble
微信、支付宝小程序BLE蓝牙SDK
Stars: ✭ 75 (-85%)
Mutual labels:  ant
Vux
Mobile UI Components based on Vue & WeUI
Stars: ✭ 17,573 (+3414.6%)
Mutual labels:  ant
ZJ-SDK-RT-Thread-NORDIC
基于RT-Thread操作系统在子敬电子ZJ-TEK系列开发板的软件开发包
Stars: ✭ 68 (-86.4%)
Mutual labels:  ant
storybook-antd
🐜 Storybook for previewing Ant Design components
Stars: ✭ 57 (-88.6%)
Mutual labels:  ant
Asynctasks.vim
🚀 Modern Task System for Project Building, Testing and Deploying !!
Stars: ✭ 495 (-1%)
Mutual labels:  ant
Blog React Admin
基于 pro.ant.design 的 react + Ant Design 的博客管理后台项目
Stars: ✭ 349 (-30.2%)
Mutual labels:  ant
lightence-admin
Free and easy-to-use admin template based on React 17+
Stars: ✭ 337 (-32.6%)
Mutual labels:  ant

python-fitparse

Here's a Python library to parse ANT/Garmin .FIT files. Build Status

Install from PyPI:

pip install fitparse

FIT files

  • FIT files contain data stored in a binary file format.
  • The FIT (Flexible and Interoperable Data Transfer) file protocol is specified by ANT.
  • The SDK, code examples, and detailed documentation can be found in the ANT FIT SDK.

Usage

A simple example of printing records from a fit file:

import fitparse

# Load the FIT file
fitfile = fitparse.FitFile("my_activity.fit")

# Iterate over all messages of type "record"
# (other types include "device_info", "file_creator", "event", etc)
for record in fitfile.get_messages("record"):

    # Records can contain multiple pieces of data (ex: timestamp, latitude, longitude, etc)
    for data in record:

        # Print the name and value of the data (and the units if it has any)
        if data.units:
            print(" * {}: {} ({})".format(data.name, data.value, data.units))
        else:
            print(" * {}: {}".format(data.name, data.value))

    print("---")

The library also provides a fitdump script for command line usage:

$ fitdump --help
usage: fitdump [-h] [-v] [-o OUTPUT] [-t {readable,json}] [-n NAME] [--ignore-crc] FITFILE

Dump .FIT files to various formats

positional arguments:
  FITFILE               Input .FIT file (Use - for stdin)

optional arguments:
  -h, --help            show this help message and exit
  -v, --verbose
  -o OUTPUT, --output OUTPUT
                        File to output data into (defaults to stdout)
  -t {readable,json}, --type {readable,json}
                        File type to output. (DEFAULT: readable)
  -n NAME, --name NAME  Message name (or number) to filter
  --ignore-crc          Some devices can write invalid crc's, ignore these.

See the documentation for more: http://dtcooper.github.com/python-fitparse

Major Changes From Original Version

After a few years of laying dormant we are back to active development! The old version is archived as v1-archive.

  • New, hopefully cleaner public API with a clear division between accessible and internal parts. (Still unstable and partially complete.)

  • Proper documentation! Available here.

  • Unit tests and example programs.

  • (WIP) Command line tools (eg a .FIT to .CSV converter).

  • Component fields and compressed timestamp headers now supported and not just an afterthought. Closes issues #6 and #7.

  • FIT file parsing is generic enough to support all types. Going to have specific FitFile subclasses for more popular file types like activities.

  • (WIP) Converting field types to normalized values (for example, bool, date_time, etc) done in a consistent way, that's easy to customize by subclassing the converter class. I'm going to use something like the Django form-style convert_<field name> idiom on this class.

  • The FIT profile is its own complete python module, rather than using profile.def.

    • Bonus! The profile generation script is less ugly (but still an atrocity) and supports every ANT FIT SDK from version 1.00 up to 5.10.
  • A working setup.py module. Closes issue #2, finally! I'll upload the package to PyPI when it's done.

  • Support for parsing one record at a time. This can be done using <FitFile>.parse_one() for now, but I'm not sure of the exact implementation yet.

Updating to new FIT SDK versions

python3 scripts/generate_profile.py /path/to/fit_sdk.zip fitparse/profile.py

License

This project is licensed under the MIT License - see the LICENSE file for details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].