home / skills / openclaw / skills / strava-python

strava-python skill

/skills/abclark/strava-python

This skill queries Strava activities, stats, and workouts via Python and stravalib with an interactive setup for easy credentials.

npx playbooks add skill openclaw/skills --skill strava-python

Review the files below or copy the command above to add this skill to your agents.

Files (6)
SKILL.md
1.7 KB
---
name: strava-python
version: 1.0.0
description: Query Strava activities, stats, and workout data using Python/stravalib with interactive setup
homepage: https://www.strava.com
metadata:
  openclaw:
    emoji: 🏃
    requires:
      bins:
        - python3
    install:
      - id: pip
        kind: pip
        package: stravalib
        label: Install stravalib (pip)
---

# Strava Python

Query your Strava activities, stats, and workout data through OpenClaw using Python and stravalib.

**Why this skill vs others:** Uses Python/stravalib with an interactive setup wizard (vs curl-based skills requiring manual JSON configuration).

## Requirements

- Python 3.7+
- `stravalib` package
- Strava API credentials (free)

## Setup

1. **Install dependencies:**
   ```bash
   pip install stravalib
   ```

2. **Run setup:**
   ```bash
   python3 setup.py
   ```

   This will:
   - Guide you through creating a Strava API app
   - Handle OAuth authentication
   - Save credentials to `~/.strava_credentials.json`

## Commands

**Recent activities:**
```bash
python3 strava_control.py recent
```

**Weekly/monthly stats:**
```bash
python3 strava_control.py stats
```

**Last activity:**
```bash
python3 strava_control.py last
```

## Examples

Ask OpenClaw:
- "Show my recent Strava activities"
- "What are my Strava stats this week?"
- "What was my last Strava workout?"

## Files

- `strava_control.py` - Main controller script
- `setup.py` - Interactive setup wizard
- `SKILL.md` - This file
- `~/.strava_credentials.json` - Credentials (auto-generated)

## Notes

- Requires Strava account (free)
- API credentials are personal and should not be shared
- Rate limits: 100 requests per 15 minutes, 1,000 daily

Overview

This skill lets you query Strava activities, stats, and workout data using Python and the stravalib library. It includes an interactive setup wizard that handles Strava API app creation and OAuth, storing credentials locally for repeated use. The skill is focused on quick access to recent activities, weekly/monthly stats, and the last workout via simple CLI commands.

How this skill works

The skill uses stravalib to communicate with the Strava API after completing an interactive setup that guides you through creating a Strava API app and OAuth flow. Credentials are saved locally so subsequent commands (recent, stats, last) run without reauthentication. CLI controller scripts call the library to fetch activities and aggregate statistics while respecting Strava rate limits.

When to use it

  • Quickly view recent Strava activities from the terminal or an agent integration.
  • Generate simple weekly or monthly performance summaries and totals.
  • Retrieve details of the most recent workout for logging or review.
  • Automate backups or archive runs of personal workout data.
  • Prototype integrations that require authenticated Strava access via Python.

Best practices

  • Install and run in a virtual environment to isolate dependencies.
  • Keep your Strava API credentials private and never commit them to version control.
  • Respect rate limits: batch requests and cache results when possible.
  • Use the interactive setup once per account; reuse saved credentials for automation.
  • Upgrade Python and stravalib periodically to incorporate API and security fixes.

Example use cases

  • Run `strava_control.py recent` to list your last several activities for quick review.
  • Execute `strava_control.py stats` at the end of the week to see total distance and time.
  • Call `strava_control.py last` from an automation to send your last workout to a chat channel.
  • Build a personal dashboard that queries the skill for periodic summaries.
  • Archive activity JSON to local storage for long-term backup.

FAQ

What do I need before running the setup?

You need Python 3.7+ and a Strava account. The setup wizard will help create the API app and run OAuth.

Where are credentials stored?

Credentials are saved to a local file in your home directory so you don't need to reauthenticate each run.