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

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.3.1.tar.gz (7.4 kB view details)

Uploaded Source

Built Distribution

strava_backup-0.3.1-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file strava-backup-0.3.1.tar.gz.

File metadata

  • Download URL: strava-backup-0.3.1.tar.gz
  • Upload date:
  • Size: 7.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for strava-backup-0.3.1.tar.gz
Algorithm Hash digest
SHA256 1607843784cd6b9a64556e2c8b4755cedea35bdbd1873c1f719f3a46e81d9f70
MD5 42176755d485c67600be711d9f78c7a3
BLAKE2b-256 35ff7687baabfaa2b29a6e5b3f28791c66fefce2cd5c36e4bcce80078b9265c0

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for strava_backup-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c1882b1d9848c19c4a8684dfa5d0aa3e64d4911a57fc6271745c4a4ca6e5d504
MD5 76b56ffac74d3409566eccc7c1ce52f5
BLAKE2b-256 fb68df6bfb85f357de7c4384536a4d3a89715d4c008df3d8143579b766cf3ad4

See more details on using hashes here.

Provenance

Supported by

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