This script fetches your strava historical data and outputs to tab separated values. You can copy into excel, or redirect into a .tsv file and import to a spreadsheet.
This script does not pull segment data, map data, or gpx data.
- This script assumes the following are installed
- python3.7
- homebrew
-
install pipenv if needed
brew install pipenv pipenv shell pipenv install
-
if you don't have a Strava Client Application, Register for one here: https://www.strava.com/settings/api
- Tips:
- Application Name: (whatever you like)
- Category: Data Importer
- Website: http://notarealsite.com or your real url
- Description: developer
- Authorization Callback Domain: localhost:4000
- Tips:
-
create your
client_secret.json
filecp client_secret.json.sample client_secret.json
-
customize your
client_secret.json
file- fill in the
client_id
(e.g. 5 digits) assigned to your registered client application - fill in your
client_secret
with the Client Secret assigned to your client application - fill in the
redirect_uri
with the fully qualified url for your Authorization Callback Domain for your client application
- fill in the
-
load environment and run
pipenv shell python strava_pull.py
-
the first time you run this
- the file
credentials.json
will be saved locally - a browser will open for the authentication flow
- the file
-
to customize:
-
edit the
strava_pull.py
script variables near the topis_celsius = False # set to True for C, False for F is_metric = False # set to True for metric, False for standard max_pages = None # set to 1 for quick test or None to get all pages
-
comment out or reorder columns in
COLUMNS_ORDERED
list
-
-
to exit pipenv environment
exit
- lookup lat/long where city is missing
- find a more performant way to gather ride detail, like calories
- what else? drop me a line.