Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Griffsano/RuntasticConverter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RuntasticConverter

Tool for analyzing exported Runtastic / Adidas Running data and importing into a workout-tracker database.

Disclaimer: This software is not affiliated with Runtastic GmbH, Adidas AG or workout-tracker.

Features

  • RuntasticAnalyzer:
    • Processes your downloaded Runtastic data
    • Generates simple overviews of your workout session data and shoes/equipment with customizable metadata information
    • Restructures and renames the GPX files of the workout sessions
  • WorkoutTracker:
    • Can be used both for existing workout-tracker databases and completely new setups
    • Adds manual workouts without GPX tracks to the workout-tracker database
    • Renames workout sessions according to the Runtastic activity notes
    • Adds comment blocks with Runtastic metadata, such as burned calories, surface information, weather conditions, and heart rate data
    • Matches Runtastic shoes with workout-tracker equipment items

Usage

Request Runtastic / Adidas Running data export

  1. Go to the Runtastic website and log in
  2. Navigate to Account & Data and click Export Data
  3. After some time, you should receive an email with the download link to your data

Analyze Runtastic Data and Restructure GPX files

  1. Clone this repository
  2. Download the Runtastic data export, unzip the file, and move its contents into the runtastic_export folder of this repository.

    Note: The relevant data is now located in runtastic_export/Sport-sessions and runtastic_export/User.

  3. Run python src/main.py

Generated Overviews/Statistics

Simple overviews about your workout sessions can be found in the statistics/*.txt files. Investigate the tables to see if all data was parsed correctly. Further columns can be added if the relevant data exists in the Runtastic data export, such as:

  • Burned calories
  • Elevation data
  • Surface information
  • Weather conditions
  • Heart rate data
  • Comments

Optional: Edit the relevant functions of the RuntasticAnalyzer class to customize the columns as desired:

  • print_shoe_statistics
  • print_sessions_with_gpx
  • print_sessions_without_gpx

Restructured GPX files

The GPX files of your workout sessions can be found in the gpx_restructured folder and are structured by:

  • Sports/activity types
  • Shoes/equipment

The names of the GPX files consist of:

  • Activity start date
  • Sports/activity type
  • Shoe/equipment
  • Workout session notes

While there is basic handling of special characters for renaming the GPX files, I'm sure not all cases are covered.

Optional: Edit the export_gpx_data function of the RuntasticAnalyzer class to change this structure or naming of GPX files, or to handle additional special characters and strings.

Optional: Overwrite Activity Notes

The notes stored in the Runtastic workout sessions will be exported to the Note/Title column of the metadata/runtastic_out.csv file. For batch editing, duplicate this file, rename it to runtastic_edit.csv, and modify its content as required.

Do not edit runtastic_out.csv directly as this file will be overwritten the next time you start this tool.

Per default, all session notes will be used as workout titles when importing into workout-tracker (see below). Thereby, column Note/Title of runtastic_edit.csv will be used as title, and column Comment will be imported as comment.

Additionally, a text block containing Runtastic metadata (such as burned calories, weather data, etc.) will be added to the end of the comments field of the workout-tracker sessions.

Import data into workout-tracker

The following describes a suggested workflow for importing all Runtastic workout sessions into workout-tracker. Before importing data in workout-tracker, follow the steps above for downloading your Runtastic data and verifying that the workout sessions are parsed correctly.

Ensure that you make a backup of your workout-tracker database before using this tool!

As the import process depends on your individual requirements, you may want to deviate from this workflow. It is recommended to make a backup of the database after each of the following sections so that you can quickly undo database changes. To verify each step, you can replace the database in the workout-tracker folder and re-start the program.

While not required, it may be helpful to use an external SQLite reader to verify the modifications in the database. For debugging purposes, you may want to replace log.setLevel("INFO") by log.setLevel("DEBUG") in log_config.py

Preparations in workout-tracker

  1. If you want to create a completely new workout-tracker database:
    • Start workout-tracker to create a new database
    • Use the interface to add your individual user(s)
  2. If you already have a workout-tracker database:
    • Ensure that you make a backup of your workout-tracker database! Store it in a completely different folder or machine to ensure it's not overwritten.
  3. If you want to import new GPX data into the workout-tracker database:
    • Use the workout-tracker interface to add new workout sessions by importing the GPX files. The import of multiple files at once is supported.

    The metadata of the workout sessions will be overwritten later. During the GPX import, you can force a certain activity type, e.g., one that you usually do not use. This helps in identifying workouts which have been updated by this tool.

  4. If you want to track sports equipment / shoes:
    • Use the workout-tracker interface to create new equipment items (if you have not already created them before)
    • Ensure that you are using the same name as used in your Runtastic export (column Name in statistics/table_shoes.txt)

    You can change the name of the equipment items later, but identical names are required for matching Runtastic shoes and workout-tracker equipment.

  5. Stop workout-tracker and copy the database to database/database.db in this repository
  6. At this point, it is recommended to create a backup of database.db so that you can quickly undo changes by restoring the database file.

Preparations in the main.py File

For the following steps, you need to edit the main.py file to interact with the database. Ideally, you just need to comment/uncomment certain lines. Refer to the comments in main.py for more information.

  1. Uncomment the lines for interacting with the workout-tracker database
  2. Optional: You may want to disable the statistics evaluation and GPX restructuring to increase execution speed
  3. Optional: For database debugging, uncomment the lines at the end of the file
  4. Run python src/main.py to see if the database is read correctly
  5. Write your workout-tracker username into workout-tracker_user.txt.

    To view all users, run this tool with database debugging lines enabled in main.py.

Add Manual Workouts without GPX files

  1. Edit main.py and uncomment the lines for adding manual workouts without GPX files
  2. Run python src/main.py and watch for warnings/errors. Repeatedly running the program should work without creating duplicate workout session entries.

Update Workout Metadata

  1. Edit main.py and uncomment the lines for updating the metadata information of the workout sessions
  2. Run python src/main.py and watch for warnings/errors
  3. Optional: You can use the database debugging lines at the end of main.py to print all workouts. Verify if the workout names/titles and activity types have been set correctly.
  4. Optional: Edit workouttracker_sport_activities.py for defining the matching behavior between Runtastic and workout-tracker activity types. Run the tool again after changing this mapping file.

Update Equipment/Shoes

  1. Edit main.py and uncomment the lines for linking equipment items to workout sessions
  2. Run python src/main.py and watch for warnings/errors
  3. Workout sessions without assigned Runtastic shoes will be exported to metadata/workout-tracker_equipment_out.csv.
  4. Duplicate this file, rename it to metadata/workout-tracker_equipment_edit.csv and enter the name of the shoes in the Equipment column. Ensure that you are using the same name as used in your Runtastic export (column Name in statistics/table_shoes.txt)

    Do not edit workout-tracker_equipment_out.csv directly as this file will be overwritten the next time you start this tool.

  5. After editing workout-tracker_equipment_edit.csv, run this tool again

    Note that the CSV file lists missing shoes in the Runtastic data export, not missing equipment in the workout-tracker database. Running this tool again will not lead to a change in workout-tracker_equipment_out.csv. Once you define an equipment and run this tool again, the equipment will be linked correctly in the database, else you will receive a warning/error.

Update the workout-tracker Database

  1. Stop workout-tracker
  2. Ensure that you make a backup of your current workout-tracker database!
  3. Replace the workout-tracker database by the database/database.db file of this repository
  4. Restart workout-tracker
  5. Verify that all data is correct. For example, check the following:
    • Workout session titles
    • Sports/activity types
    • Runtastic metadata block in the comments
    • Linked equipment items
    • Number of workouts assigned to each equipment

About

Tool for analyzing exported Runtastic / Adidas Running data and importing into a workout-tracker database

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages