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

Uploaded Source

Built Distribution

strava_backup-0.3.2-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: strava_backup-0.3.2.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.3

File hashes

Hashes for strava_backup-0.3.2.tar.gz
Algorithm Hash digest
SHA256 00372e5f6f1eebd5cbe51b8c39fb0d0a26b6127f0591295b96c5425f1aa091ca
MD5 05b54a1421bcd479160d7580052ec48a
BLAKE2b-256 73e5dda20f274c9aab3e3c8a250dbeeea71d24f725e1965df92892e9fb85bf51

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for strava_backup-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 683a1dc97f36ccd22f7731915bfcdd29bb502c2e1ff1ada22193dde9c256ece0
MD5 7d3c69cdf1641341d19dd135535f67ea
BLAKE2b-256 4ce7a0cc34e3eb97f1b173c532217f27aefad06178a936022f40234d3ed3282f

See more details on using hashes here.

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