This current state of the project is early beta, which means that features can be added, removed or changed in backwards incompatible ways.

Today we are happy to announce the initial release of runpandas, which makes it easier to perform data analysis from your running sessions stored at tracking files from cellphones and GPS smartwatches or social sports applications such as Strava, MapMyRUn, NikeRunClub, etc. It is designed to make the pandas data analysis package support reading, transforming and enable running metrics analytics.

How to use runpandas

Require the runpandas module in you Python Code and use our tracking file reader in case of reading local files in tcx, gpx or fit format.

# !pip install runpandas
import runpandas as rpd
activity = rpd.read_file('./data/sample.tcx')

The data file is loaded into a runpandas.Activity , which is a subclass of the pandas.DataFrame and provides some additional features. The library also provides for certain columns specific methods that extends the pandas.Series subclasses. In this example below, we get time, altitude, distance, heart rate and geo position (lat/long).

activity.head(5)
alt dist hr lon lat
time
00:00:00 178.942627 0.000000 62.0 -79.093187 35.951880
00:00:01 178.942627 0.000000 62.0 -79.093184 35.951880
00:00:06 178.942627 1.106947 62.0 -79.093172 35.951868
00:00:12 177.500610 13.003035 62.0 -79.093228 35.951774
00:00:16 177.500610 22.405027 60.0 -79.093141 35.951732

For instance, if you want to get the base unit for the altitude alt data or the distance dist data:

activity.alt.base_unit
'm'
activity.alt.sum()
65883.68151855901
activity.dist.base_unit
'm'
activity.dist[-1]
4686.31103516

Since the Activity is a DataFrame, we can play with data and create some visualizations. In this example we use the built in matplotlib based plot function to present the distance x time.

activity[['dist']].plot()
<AxesSubplot:xlabel='time'>

Finally, let's watch a glimpse of the map route by plotting a 2d map using logintude vs latitude.

activity.plot(x='lon', y='lat')
<AxesSubplot:xlabel='lon'>

That's some of features available! Please check out the runpandas docummentation link for the package's full API.

How to install runpandas

The release version of runpandas (0.1.0) is available on PyPI, the Python Package Index repository as runpandas link.

If you haven't already installed, start by downloading and installing with pip:

$ pip install runpandas --upgrade

Please note that we currently only support Python 3.6+. You are now ready to start using the runpandas.

Roadmap

We have big plans for runpandas, including not limited to:

  • Adding suport reading running tracking sessions from social application Strava;
  • Adding support reading track files giving a directory as parameter;
  • Better docummentation with user guide and install guidelines;
  • Support to session of activities
  • Support to special plots such as routes, average heart zones, personal bests for specific distances.

You can see the live roadmap of features at our issues repository.

Thanks

It is our first release after two months of planning and coding. We hope that you find runpandas helpful - it is still very young, and result of some of my ideas and needs to perform personal running analysis. So don't be afraid to get in touch and let us know what features you would like to add next, Feel free to raise an issue if you spot any bugs!