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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for strava-backup-0.3.0.tar.gz
Algorithm Hash digest
SHA256 99d94981a14727406482ba677bd60114464b982fdb1cba5491da1b011efaeec0
MD5 999b390da37757377480e7cae6b1c89a
BLAKE2b-256 203c5ac7f10012327f1dd4f66d6a94ae5f8a71f2f705f6cabb1fc27c0d95268d

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for strava_backup-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8280f3473fbb4cd45cb64f0084c10835cbabdd131727ab608f8cec2ec036408a
MD5 11d23881b6df596b014f3cd674b7c2c4
BLAKE2b-256 0fbeed1d26a759adc980dc93b002e4de67168cad2c884d73f41b9901c026d90a

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