Skip to main content

Get your data back from Strava

Project description

Strava-Backup

Get your data back from Strava.

Strava has an export options, but it will only give you the GPX files that Strava produces after analyzing your uploads.

Thankfully, there is a hidden option to download the original file for individual activities. However, this is only available on the website and not via the API.

This tool uses the API to get a list of all your events, then web scraping to log into the site using your username and password and download the original files for all your activities.

The "original file" will usually be either a *.fit file (most Garmin devices), *.tcx, *.gpx, or *.json (Strava mobile application).

The tool will also output a *.meta.json file for every activity that includes more information on the activity (name, description, type, distance, equipment, etc).

Additionally, the tool will backup your shoes and bikes information, as well as any photos that have been added to activities.

Authentication

Accessing the Strava API requires a short-term access token. In order access your account on an ongoing basis, strava-backup requires a long-term "refresh token" and some other information with which it can generate access tokens. For more information see the Strava API authentication documentation.

A "refresh token" can be generated using a separate program such as strava-tokengen.

In order to back up your data, strava-backup can use the following scopes (all optional):

  • profile:read_all ("View your complete Strava profile"): Will read and backup gear data
  • activity:read ("View data about your activities"): Will read and backup activity data
  • activity:read_all ("View data about your private activities"): Will read and backup private activity data

Accessing the activity data requires web scraping which requires logging into the website. This requires either a username and password, or a JWT token from a previously-authenticated session. Note that JWT tokens expire periodically so providing a username and password is required for running the backup on an ongoing basis.

Setup

Use pip to install this package:

pip install strava-backup

By default, strava-backup will look for a config file called strava-backup.conf in $XDG_CONFIG_HOME/, falling back to ~/.config/ if it's unset. An alternate file can be specified using the --config option.

A sample config file has been included in this package. Copy it to the correct spot and fill in the required information.

Running

strava-backup is an incremental backup. It tracks what has already been downloaded by looking at the output directory and doesn't download it again.

To download all new data, simply run strava-backup. See strava-backup --help for other options. To backup data on an ongoing basis, configure your system to call strava-backup periodically (see the /contrib folder for examples).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

strava_backup-0.4.0.tar.gz (8.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

strava_backup-0.4.0-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

Details for the file strava_backup-0.4.0.tar.gz.

File metadata

  • Download URL: strava_backup-0.4.0.tar.gz
  • Upload date:
  • Size: 8.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for strava_backup-0.4.0.tar.gz
Algorithm Hash digest
SHA256 68bd0f480af672679bc08d867c938c996cd352c4ed483285f2ec43cfadb3b529
MD5 eb02353da6e2c013cc1e25209d83a1b7
BLAKE2b-256 814912738586155c44589419649796ddd3e193e16d2ebe802b2dacc7f7f9475d

See more details on using hashes here.

File details

Details for the file strava_backup-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: strava_backup-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 9.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for strava_backup-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2310c48d3f66fbdfdd7a09f33eb8979c29887d2191c014453759e09c40630e9a
MD5 d28e26c1ac4972035e39a1fc5ab13dd9
BLAKE2b-256 c5ee65a30d4ea5b117f0ef0feb3f5b88fa722d0b36a2ee3a7cefb220972acf41

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page