Skip to main content

Python library for analysis of ANT/Garmin .fit files

Project description

heartandsole

Python library for analysis of running data files.

Python 3.6 License


Table of Contents


Introduction

heartandsole is designed to work with running or walking activity files. It allows for extraction of data from a .fit file as well as calculations, such as the following:

  • elapsed time
  • moving time
  • average heart rate
  • running power (based on Dr. Philip Friere Skiba's GOVSS algorithm)
  • average running power
  • normalized running power (based on information publicly available about TrainingPeaks' NP® and NGP®, and Dr. Philip Friere Skiba's GOVSS algorithm)
  • intensity (based on information publicly available about TrainingPeaks' IF®)
  • training stress (based on information publicly available about TrainingPeaks' TSS® and Dr. Philip Friere Skiba's GOVSS algorithm)

My impetus for this project was to implement a version of Philip Friere Skiba's GOVSS algorithm (with tweaks to better align with the underlying research). The end result will be a free, open-source version of proprietary calculations found in platforms like Strava and Training Peaks. My hope is that other runners will benefit as I have from taking these secret algorithms out of their black box, by understanding the science behind these calculations and training smarter.

This package was originally forked from Michael Traver's fitanalysis package, but the two projects diverged significantly enough for me to move my fork to a separate repository. I am indebted to Michael for writing such a clean, useful, easy-to-understand package that served as heartandsole's starting point.


Dependencies and Installation

Pandas, NumPy, fitparse, and spatialfriend are required.

pip install heartandsole to install.


Example

heartandsole provides the Activity class.

import heartandsole

activity = heartandsole.Activity('my_activity.fit')

print(activity.elapsed_time)
print(activity.moving_time)

# Also available for heart rate and cadence.
print(activity.mean_power)

# Uses power values from .fit file if available,
# otherwise calculates running power from speed,
# distance, and elevation data.
print(activity.norm_power)

# Intensity and training stress calculations require
# a functional threshold power value (in Watts/kg).
print(activity.intensity(17.0))

Construction of an Activity parses the .fit file and detects periods of inactivity. The decision to remove inactive periods is left to the user.


Project Status

Complete

Current Activities

Future Work


References

Coggan, A. (2012, June 20). Re: Calculate Normalised Power for an Interval [Online forum comment]. Retrieved June 14, 2017, from http://www.timetriallingforum.co.uk/index.php?/topic/69738-calculate-normalised-power-for-an-interval/&do=findComment&comment=978386

Coggan, A. (2016, February 10). Normalized Power, Intensity Factor and Training Stress Score. TrainingPeaks. Retrieved June 14, 2017, from https://www.trainingpeaks.com/blog/normalized-power-intensity-factor-training-stress/

Coggan, A. (2003, March 13). TSS and IF - at last! [Online forum post]. Retrieved June 14, 2017, from http://lists.topica.com/lists/wattage/read/message.html?mid=907028398&sort=d&start=9353

Di Prampero, P. E., Atchou, G., Brückner, J. C., & Moia, C. (1986). The energetics of endurance running. European Journal of Applied Physiology and Occupational Physiology, 55(3), 259-266.

Di Prampero, P. E., Capelli, C., Pagliaro, P., Antonutto, G., Girardis, M., Zamparo, P., & Soule, R. G. (1993). Energetics of best performances in middle-distance running. Journal of Applied Physiology, 74(5), 2318-2324.

Eckner, A. (2017, April 3). Algorithms for Unevenly Spaced Time Series: Moving Averages and Other Rolling Operators. Retrieved June 14, 2017, from http://eckner.com/papers/Algorithms%20for%20Unevenly%20Spaced%20Time%20Series.pdf

Friel, J. (2009, September 21). Estimating Training Stress Score (TSS). TrainingPeaks. Retrieved June 22, 2017, from https://www.trainingpeaks.com/blog/estimating-training-stress-score-tss/

Minetti, A. E., Moia, C., Roi, G. S., Susta, D., & Ferretti, G. (2002). Energy cost of walking and running at extreme uphill and downhill slopes. Journal of Applied Physiology, 93(3), 1039-1046.

Pugh, L. G. E. (1971). The influence of wind resistance in running and walking and the mechanical efficiency of work against horizontal or vertical forces. The Journal of Physiology, 213(2), 255-276.

Skiba, P. F. (2006, September 16). Calculation of Power Output and Quantification of Training Stress in Distance Runners: The Development of the GOVSS Algorithm. RunScribe. Retrieved August 20, 2019, from http://runscribe.com/wp-content/uploads/power/GOVSS.pdf


Contact

Reach out to me at one of the following places!


License

License

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

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

heartandsole-0.0.8.tar.gz (14.8 kB view details)

Uploaded Source

Built Distribution

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

heartandsole-0.0.8-py3-none-any.whl (17.1 kB view details)

Uploaded Python 3

File details

Details for the file heartandsole-0.0.8.tar.gz.

File metadata

  • Download URL: heartandsole-0.0.8.tar.gz
  • Upload date:
  • Size: 14.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.9

File hashes

Hashes for heartandsole-0.0.8.tar.gz
Algorithm Hash digest
SHA256 01f6737d9267500a927d52d305b7dda36c3f9ad55ed9078a6ce4f4d93f9ec84f
MD5 b1de1b75c591410b0c93eef5e353f19e
BLAKE2b-256 0170f05474b1938d43e6a8bb84cae2934cf7e7679da1add7900afba2228faf0b

See more details on using hashes here.

File details

Details for the file heartandsole-0.0.8-py3-none-any.whl.

File metadata

  • Download URL: heartandsole-0.0.8-py3-none-any.whl
  • Upload date:
  • Size: 17.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.9

File hashes

Hashes for heartandsole-0.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 21489e5cd22e410d1a8788d1bb44df7db9a9bc71d6c459cb11cf1ec331dc44a3
MD5 34aae44582ea2d3bbe4bbef08fe46225
BLAKE2b-256 b466adadf3da993f7b370f9292c11f7d9e258148ceb4ce3507f2640ddf9dfcac

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