This is a python implementation of a migration tool for the Adidas Running data to Strava. The migration works in a way that the script takes files with Adidas Running activity data and creates a new activity with this data. The data is the uploaded to Strava environment in a form of POST request.
The app was implemented in Python 3.7.2. To download the dependecies, pip manager is the best option.
All dependencies necessary for running this app are included in requirements.txt
file. Before executing the scripts, run
$ pip install -r requirements.txt
This is a diagram of the implemented process:
Application needs to have an access to user's profile. This is done by running the code:
$ python get_client_access_token.py <client_id> <client_secret>
Note, that client_id
and client_secret
are permanent tokens and can be found in a personal profile of a user, here. This is an overview of a page where we can find this information.
Running the code will pop up a Strava link which requires an authorization confirmation for our application - among other things, read and write permissions. Here, the user needs to click "Authorize" button (see below).
After authorizing the necessary rights, a user is redirected to another page, where a code appears. This needs to be run as a first argument for runtastic_strava_migration_tool.py
. The redirect page can look like the one below.
To migrate user's Runtastic data to Strava, the following command needs to be run:
$ python runtastic_strava_migration_tool.py <access_token> <data_type> <path>
Arguments:
- "access_token" is received from previous step,
- "data_type" is one (and only one) of the json|csv|gpx options,
- "path" is a relative path to data a user wants to migrate
Example:
$ python runtastic_strava_migration_tool.py 75c63be434b56ac4dd279592c3462b4262e43f5b gpx ../data/Sport-sessions/GPS-data/
The script automatically reads all relevant data in the particular directory.
To check the outcome of the migration, a user can visit activity section of the personal profile. Below we can see an example of migrated GPS data of an activity.
If we scroll down, we can also see particular checkpoints of this activity.
Tomas Drietomsky orcid.org/0000-0002-3814-6000