Skip to main content

strava-ical

PyPI Python Version badge PyPI Version badge License badge

Overview

Generate iCalendar with your Strava activities

Uses strava-offline to keep and incrementally sync with a local database of activities.

Example screenshot of the output in Google Calendar

Installation

Using pipx:

pipx ensurepath
pipx install "strava-ical[strava]"

To keep a local git clone around:

git clone https://github.com/liskin/strava-ical
make -C strava-ical pipx

Alternatively, if you don't need the isolated virtualenv that pipx provides, feel free to just:

pip install "strava-ical[strava]"

If you've already installed strava-offline and use it separately, you can omit the [strava] bit to avoid installing strava-offline twice.

Setup and usage

  • Run strava-ical-sync (or strava-offline sqlite if you chose to install strava-offline separately) to synchronize activities metadata to a local sqlite database. This takes a while: first time a couple dozen seconds, then it syncs incrementally which only takes a few seconds each time. Add -v to see progress.

    The first time you do this, it will open Strava in a browser and ask for permissions. Should you run into any trouble at this point, consult strava-offline readme or open an issue.

    If you make changes to older activities (to assign a different bike to a ride, for example), you may need a --full re-sync rathen than the default incremental one. See the note about incremental synchronization for a detailed explanation.

  • Run strava-ical:

    $ strava-ical --max-size 1M -o strava-activities.ical
    
  • Import strava-activities.ical into your calendar app of choice.

    (Note that Google Calendar refreshes iCal URLs once a day and cannot be tweaked in any way. Manual refresh isn't possible either.)

Command line options

$ strava-ical --help
Usage: strava-ical [OPTIONS]

  Generate iCalendar with your Strava activities

Options:
  --csv FILENAME          Load activities from CSV instead of the strava-offline database (columns: distance,
                          elapsed_time, id, moving_time, name, start_date, start_latlng, total_elevation_gain, type)
  --strava-database PATH  Location of the strava-offline database  [default:
                          /home/user/.local/share/strava_offline/strava.sqlite]
  -o, --output FILENAME   Output file  [default: -]
  -m, --max-size SIZE     Maximum size of the output file in bytes (accepts K and M suffixes as well)
  --help                  Show this message and exit.

Donations (♥ = €)

If you like this tool and wish to support its development and maintenance, please consider a small donation or recurrent support through GitHub Sponsors.

By donating, you'll also support the development of my other projects. You might like these:

  • strava-offline – Keep a local mirror of Strava activities for further analysis/processing
  • strava-gear – Rule based tracker of gear and component wear primarily for Strava
  • strava-map-switcher – Map switcher for Strava website
  • foursquare-swarm-ical – Sync Foursquare Swarm check-ins to local sqlite DB and generate iCalendar

Metadata

Release files for strava-ical 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for strava-ical 1.0.0
File Size Uploaded
strava-ical-1.0.0.tar.gz 14.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for strava-ical 1.0.0
File Interpreter ABI Platform
strava_ical-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 23.9 kB

Release files / strava-ical-1.0.0.tar.gz

Download URL strava-ical-1.0.0.tar.gz
Size 14.7 kB
Tags Source
SHA-256 checksum
How to use checksums
07b7406ac69c6e07c6a4982a0e42b3ac91d66298e203880e10a24605c2ccf6d8
BLAKE2b-256 checksum
How to use checksums
c5f6396421b9575895939372c229fff041f88568b56981e2598434aabc62ab04
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.8

Release files / strava_ical-1.0.0-py3-none-any.whl

Download URL strava_ical-1.0.0-py3-none-any.whl
Size 9.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5eba952b80974ac060eb6495e33a851d9ec16cce9d41e7a8fb88aad05da7ab57
BLAKE2b-256 checksum
How to use checksums
b7554c21f00d94ae5fb268d4ea737a7783ece52e0826a49461a13350f46a538b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.8
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page