Giter Club home page Giter Club logo

pyworkout-toolkit's Introduction

pyworkout-toolkit

pyworkout-toolkit: Python tools to process workout data and telemetry

Summary

The pyworkout-toolkit is a Python package that provides tools for post-workout analysis of data or telemetry. The majority of the tools cater to coaches and invidividuals who wish to utilize the data to generate metrics or exercise machine learning/data mining. The toolkit provides parsing of the popular .TCX and .GPX formats, along with some general purpose functions that help preprocess the data for metrics, visualization, or machine learning.

Features

  • Parsing of .TCX and .GPX formats; other formats being considered
  • Caters to the Pandas DataFrame for analysis flexibility and use in Scikit-Learn
  • Helper functions to correct sport-specific errors in recording
  • Handling of missing data and conversion/correction of GPS units
  • Exporting to popular formats such as CSV, HDF5

Examples

Parsing of TCX files is simple:

from pyworkout.parsers import tcxtools
workout_data = tcxtools.TCXPandas('pyworkout/tests/data/test_dataset_1.tcx') # Create the Class Object
workout_data.parse() # Returns a dataframe

Other details about the TCX file can be found as well:

workout_data.get_sport()
'Biking'

workout_data.get_workout_startime()
'2016-10-20T22:01:26.000Z'

If opening multiple TCX files for large-scale reporting, it is recommended that Dask and Dask Delayed be used:

import dask.dataframe as dd
from dask import delayed

tcx1 = delayed(tcxtools.TCXPandas('workout_1.tcx').parse()) # Delay these calculations
tcx2 = delayed(tcxtools.TCXPandas('workout_2.tcx').parse()) # Use as many as needed

total = dd.from_delayed([tc1, tc2]) # However many files you need
total.visualize() # Visualize the task graph
total.compute() # Compute it
# This returns a dataframe with all the files

Getting your data

In order to get your data in TCX format, you will need to export the files from the given service.

Please note that the TCX format will make certain workouts absent of important metadata, such as those used to identify swim workouts. In these cases, specifying workout type upon class instantiation is recommended.

Dependencies

  • NumPy
  • Pandas
  • lxml
  • Python 3+ (developed on 3.5.2)

Installation

Local installation is supported, with pip and conda-build files included. Currently available on pip and conda.

pip installation:

pip install pyworkout-toolkit

conda installation:

conda install -c triskadecaepyon pyworkout=0.0.1

License

BSD

Scope and goals

The pyworkout-toolkit aims to assist in the furthering of research in the health/wearables area by providing the tools necessary to process, correct, and analyze collected data. The project was created to fill the gap between data aquisition on the device to the end-developer, allowing for algorithm creation, data mining, and visualization once the data has been converted. Eventual integration with graphing libraries have been planned, with Matplotlib, Bokeh, and Datashader on the list.

pyworkout-toolkit's People

Contributors

triskadecaepyon avatar bluesquall avatar

Watchers

Ewan Douglas 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.