Bulk convert GPX files from Strava to a CSV

Strava has the option to "Bulk Export GPX" data.  A GPX file is an XML schema file which stores GPS data, and associated way points, tracts, and routes.  We can use this data, as opposed to the Strava API, to generate maps and analysis of our data.


To get started, open up Strava and download your GPX files.  To do this, navigate to your Account Settings page, and click the link below in the bottom right corner of your dashboard.


Next, open your email and move the file sent to you to a new folder on your computer.  Extract the zipped file contents to a new folder, named "data". 

Using Python, we will now extract the GPX data to CSV using the libraries "Pandas" for data processing, and "GPXPY" for parsing the XML data from the GPX files into a Python dictionary.

Above is an overview of the parsing process in an Ipython Notebook.  All you have to do is change the INDIR and OUTDIR variables in the first cell to match the source of your data, and where you want to write your CSV file out to.

Here is the file as .PY script you can run if you have the proper Python libraries installed.


Now we can import the data into any program we want for analysis or mapping.