Release 0.2.0 and support to Strava!
Runpandas package comes with new features and improved docs!
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.
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.
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
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)
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.