Code Monkey home page Code Monkey logo

stravaexport-fix's Introduction

STRAVA export fix

Simple Python script to unzip any GZ archives and convert tcx activities to the unified gpx format. After the conversion the tool updates your activities.csv filenames accordingly, the tool can be safely executed on the already converted activities.

Requirements

  • GPSbabel:
    • RHEL/Centos sudo yum install gpsbabel
    • Ubuntu sudo apt-get install gpsbabel
    • Windows: download and mare sure the script can reach path or copy the gpsbabel.exe to the repo root
  • Python 3.4+ (tested on Windows and Linux)
  • Strava archive file containing folder activites.csv and folder activities with individual files.

How to get all Strava tracks

  • Login to strava.com
  • Go to your profile, click My Account, click Download or Delete Your Data then Get Started button. Don't worry nothing gets deleted.
  • Under point 2 click button Request Your Archive.
  • You should receive within an email within a few hours with a link to your ZIP archive
  • Download the archive

How to use this tool

  • Clone this repository
  • Unzip thee strava zip file into unzipped folder
  • You may see in the folder miscellaneous file extensions .tcx, .tcx.gz or .gpx.gz files, eg.
$ cd /home/jarda/WORKING/
$ clone https://github.com/lhotakj/stravaexport-fix.git
...
$ unzip <your-downloaded-archive -d ./unzipped
...
$ cd ./stravaexport-fix/unzipped/activities/
$ ls
1008247839.gpx  1019050643.gpx  1022095894.gpx.gz  1029478699.gpx.gz  1440081027.tcx.gz  1440081322.tcx.gz  1440081476.tcx.gz
  • Run ./run.py or eg. C:\Python37\python run.py under Windows
  • You should be getting the following progress:
$ ./run.py
Reading './unzipped/activities.csv'
Found <number> activities
Unzipping ...
Progress:  100%
Normalizing ...
./unzipped/activities/1008247839.gpx    | Ride         | <activity name>
./unzipped/activities/1019050643.gpx    | Walk         | <activity name>
...
...
./unzipped/activities/1022095894.gpx    | Ride         | <activity name>
./unzipped/activities/1029478699.gpx    | Ride         | <activity name>
./unzipped/activities/1440081027.gpx    | Ride         | <activity name>
Backing up the original activities as './unzipped/activities.csv.original' ...
Saving new activities ...
  • All your activities in activities folder are now in .gpx format

Future development

  • Adding name and activity type to converted .tcx files - coming soon
  • Improved error handling
  • Export the activities to XLS(X) files
  • Parametrized execution

Known issues

  • None :) If you encounter any issue, feel free to report it in the GitHub issues.

stravaexport-fix's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.