Skip to main content

Create artistic visualisations with your exercise data

Project description

strava_py

Create artistic visualisations with your exercise data (Python version).

This is a port of the R strava package to Python.

Installation

Install via pip:

python3 -m pip install stravavis

For development:

git clone https://github.com/marcusvolz/strava_py
cd strava_py
pip install -e .

Then run from the terminal:

stravavis --help

Examples

Facets

A plot of activities as small multiples. The concept behind this plot was originally inspired by Sisu.

facets

Map

A map of activities viewed in plan.

map

Elevations

A plot of activity elevation profiles as small multiples.

map

Landscape

Elevation profiles superimposed.

map

Calendar

Calendar heatmap showing daily activity distance, using the calmap package. Requires "activities.csv" from the bulk Strava export.

map

Dumbbell plot

Activities shown as horizontal lines by time of day and day of year, facetted by year. Requires "activities.csv" from the bulk Strava export.

map

How to use

Bulk export from Strava

The process for downloading data is described on the Strava website here: [https://support.strava.com/hc/en-us/articles/216918437-Exporting-your-Data-and-Bulk-Export#Bulk], but in essence, do the following:

  1. Log in to Strava
  2. Select "Settings" from the main drop-down menu at top right of the screen
  3. Select "My Account" from the navigation menu to the left of the screen.
  4. Under the "Download or Delete Your Account" heading, click the "Get Started" button.
  5. Under the "Download Request", heading, click the "Request Your Archive" button. Don't click anything else on that page, i.e. particularly not the "Request Account Deletion" button.
  6. Wait for an email to be sent
  7. Click the link in email to download zipped folder containing activities
  8. Unzip files

Process the data

The main function for importing and processing activity files expects a path to a directory of unzipped GPX and / or FIT files. If required, the fit2gpx package provides useful tools for pre-processing bulk files exported from Strava, e.g. unzipping activity files (see Use Case 3: Strava Bulk Export Tools).

df = process_data("<path to folder with GPX and / or FIT files>")

Some plots use the "activities.csv" file from the Strava bulk export zip. For those plots, create an "activities" dataframe using the following function:

activities = process_activities("<path to activities.csv file>")

Plot activities as small multiples

plot_facets(df, output_file = 'plot.png')

Plot activity map

plot_map(df, lon_min=None, lon_max= None, lat_min=None, lat_max=None,
             alpha=0.3, linewidth=0.3, output_file="map.png")

Plot elevations

plot_elevations(df, output_file = 'elevations.png')

Plot landscape

plot_landscape(df, output_file = 'landscape.png')

Plot calendar

plot_calendar(activities, year_min=2015, year_max=2017, max_dist=50,
              fig_height=9, fig_width=15, output_file="calendar.png")

Plot dumbbell

plot_dumbbell(activities, year_min=2012, year_max=2015, local_timezone='Australia/Melbourne',
              fig_height=34, fig_width=34, output_file="dumbbell.png")

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

stravavis-0.3.0.tar.gz (223.5 kB view details)

Uploaded Source

Built Distribution

stravavis-0.3.0-py3-none-any.whl (11.8 kB view details)

Uploaded Python 3

File details

Details for the file stravavis-0.3.0.tar.gz.

File metadata

  • Download URL: stravavis-0.3.0.tar.gz
  • Upload date:
  • Size: 223.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for stravavis-0.3.0.tar.gz
Algorithm Hash digest
SHA256 e0c32a1b01c72a1e380ee2e8f79427d54c24917c2a169636763297841d457a78
MD5 49a6209d4a01e1f2a163538f56bb724f
BLAKE2b-256 42846f98176cf7e0b9ff5c7017ccb22580d63e65989ec1b770a7c4d058b5719e

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: stravavis-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 11.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for stravavis-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0492f54ecf39a557c2bbe160ce26f46582f8d3e491bde44ca0ba33adc0eda257
MD5 5e544dd910ee798522311f728bf5e022
BLAKE2b-256 66d4cea30bc2e3b3c2fac99b31d8fc72ec8dcc6837174840ae1b4e65604f74b9

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