Release 0.5.2 improvements on support to Python 3.10 and new Pandas releases. Strava Client Authentication now integrated!
New release of runpandas comes with Python and Pandas new releases support and Strava Client Authentication tool now integrated.
This current state of the project is
early beta
, which means that features can be added, removed or changed in backwards incompatible ways.
We published this minor release with some bug fixes , new Python and Pandas releases support and Strava Client Authentication. In this release of RunPandas 0.5.2, we include:
- CI now updated to include build tests with Python 3.9 and Python 3.10. It removed 3.6 Python official support.
- CI now updated to include build tests with Pandas version 1.4.2 .
- Strava comes with social client authentication tool integrated. Thanks to contributor @bitner !
- Fixes on Test suite and read the docs build suite.
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.
In order to download the Strava activities, you must authenticate your dev app through Strava servers in order to get a valid access token. Previously, this task had to be performed outside runpandas. Now Runpandas is powered with this handful tool, so you can easily can get the access token and store it locally , so you can use it as long as it doesn't expire it.
Screenshot from the Strava Authentication Authorization WebSite
We load the environment variables from our terminal or use a .env file with the STRAVA social app personal access tokens. You can create your own using the link instructions here: https://developers.strava.com/
%load_ext autoreload
%autoreload 2
import warnings
warnings.filterwarnings('ignore')
import runpandas
import os
import pandas as pd
pd.set_option('display.max_rows', 500)
from dotenv import load_dotenv
load_dotenv()
Firstly, import the runpandas StravaClient, create a Client instance, and read in the client ID and secret loaded previously. Next the one time authentication. The command client.authenticate_web will open a browser with a URL for the athlete to use to approve access to their data from the app.
The athlete is then prompted to log in to the Strava website and give consent to the requesting application. Once the user authorizes, it will store the access token and refresh token. From this point this access token, which lasts for 6 hours, will be what you need to access data. The client also save it locally so it can be re-read and refreshed as needed.
client = runpandas.StravaClient()
client.authenticate_web()
As shown above, the activity now after loaded can be analysed as any other activity in runpandas!
activity = runpandas.read_strava('7329257123')
activity.summary()
The next releases will focus on supporting marathon results and some plots support. It will be awesome, keep tunned!
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.