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

We are very excited to announce RunPandas 0.2. This release comes with new features and fixes, let's highlight them:

  • Improved docummentation with new sections such as User Guide, Install Guide, API Reference and Changelog.
  • Support to new code and docummentation third-party plugins like CodeFactor, Pepy, Zenodo and Binder.
  • Support to read multiple tracking files from a single directory
  • Added the feature of fetching activity data from social network Strava.

What is Runpandas?

Runpandas is a python package based on pandas data analysis library, that 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 enable reading, transforming and running metrics analytics from several tracking files and apps.

Main Features

Read multiple tracking files from a single directory

With the new module function runpandas.read_dir , you can reall all the files in a directory and iterate over them. It uses runpandas.read_file and returns a generator. It is important to notice that read_dir expects all the files to be of a supported file format in the directory.

from pathlib import Path

import runpandas

directory = Path("path/to/some/dir/")

for activity in runpandas.read_dir(directory):
    # Do things with the activities

Support to fetch activity stream data from Strava

We addded the support to fetch a single activity stream from the social sports app Strava. The function runpandas.read_strava assumes that you have an API access token and already performed an API authentication. You can use a support script available at our repository strava_auth_handler.py that we developed using the library stravalib. The basic usage is simple and it saves the API token into a file.

It is required to have a client_id and and a client_secret, for that you must have a developer account at strava and create an application. See further at strava: (https://developers.strava.com/)

Here a simple example about how to call :

$ python scripts/strava_auth_handler.py --client_id YOUCLIENTID --client_secret YOURCLIENTSECRET
$ more access_token.json

"{\"access_token\": \"YOURACCESSTOKEN\", \"refresh_token\": \"YOURREFRESHTOKEN\", \"expires_at\": 1607634877}"

read_strava() returns a runpandas.Activity with column runpandas.MeasureSeries matching Runpandas nomenclature.

#Disable INFO Logging for a better visualization
import logging
logging.getLogger().setLevel(logging.CRITICAL)
import runpandas

activity = runpandas.read_strava(activity_id=4437021783, access_token="c1370af8341f5c5696988d54a1560130737f5954")

activity.head(5)
2020-12-06 06:36:27
moving velocity_smooth grade_smooth alt cad dist hr lon lat
time
00:00:00 False 0.0 1.1 6.4 79 0.0 111 -34.847439 -8.016994
00:00:04 True 1.4 1.2 6.4 79 5.6 111 -34.847324 -8.016978
00:00:06 True 1.6 0.9 6.5 79 9.5 111 -34.847252 -8.016969
00:00:09 True 2.3 1.2 6.6 79 16.9 111 -34.847221 -8.016894
00:00:12 True 2.3 1.1 6.6 79 23.2 111 -34.847176 -8.016860

Thanks

We are constantly developing Runpandas improving its existing features and adding new ones. We will be glad to hear from you about what you like or don’t like, what features you may wish to see in upcoming releases. Please feel free to contact us.