{"id":27425,"library":"stravalib","title":"stravalib","description":"A Python library for accessing the Strava V3 REST API. Current version is 2.4, requires Python >=3.10. Follows semantic versioning.","status":"active","version":"2.4","language":"python","source_language":"en","source_url":"https://github.com/stravalib/stravalib","tags":["strava","api","fitness","running","cycling","v3","client"],"install":[{"cmd":"pip install stravalib","lang":"bash","label":"Install via pip"}],"dependencies":[{"reason":"HTTP library used for API requests","package":"requests","optional":false},{"reason":"Date/time handling","package":"arrow","optional":false}],"imports":[{"note":"Client is in stravalib.client module since v2.0","wrong":"from stravalib import Client","symbol":"Client","correct":"from stravalib.client import Client"},{"symbol":"strava_client","correct":"from stravalib import strava_client"}],"quickstart":{"code":"import os\nfrom stravalib.client import Client\n\nclient = Client()\nclient.access_token = os.environ.get('STRAVA_ACCESS_TOKEN', '')\n\n# Example: get current athlete\nathlete = client.get_athlete()\nprint(f\"Hello {athlete.firstname} {athlete.lastname}\")","lang":"python","description":"Set up a client with an access token and fetch the authenticated athlete's profile."},"warnings":[{"fix":"Update imports: from stravalib.client import Client","message":"In v2.0, the import path changed from `from stravalib import Client` to `from stravalib.client import Client`.","severity":"breaking","affected_versions":">=2.0"},{"fix":"Review attribute names if upgrading from 1.x. Refer to v2 migration guide.","message":"Many model attributes changed from camelCase to snake_case in v2.0. For example, `athlete.firstname` became `athlete.firstname` (same) but some like `activity.start_date` changed from `start_date` to `start_date`? Actually check: `athlete.firstname` is still correct, but `athlete.lastname` used to be `athlete.lastname`. No breaking change reported. But be aware of renamed methods: e.g., `get_athlete` remains same.","severity":"breaking","affected_versions":">=2.0"},{"fix":"Iterate over result or convert with list().","message":"Some methods now return paginated results as generators instead of lists.","severity":"breaking","affected_versions":">=2.0"},{"fix":"Use `from stravalib.client import Client` instead.","message":"`strava_client` module is still available but considered legacy; new code should use `Client` directly.","severity":"deprecated","affected_versions":">=2.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Use `from stravalib.client import Client`","cause":"Incorrect import path. In v2.0+, Client is in stravalib.client module.","error":"ImportError: cannot import name 'Client' from 'stravalib'"},{"fix":"Check attribute names with dir(athlete) or consult docs. Known changes: 'city' -> 'city' (same), 'state' -> 'state', 'sex' -> 'sex'.","cause":"In v2.0, camelCase attributes changed to snake_case. For example, 'firstname' remains 'firstname', but 'lastname' is still 'lastname'. Actually check: no change for firstname/lastname. This error might be due to using v1.x code on v2.x where some attributes changed. Example: 'email' vs 'email'? Verify.","error":"AttributeError: 'Athlete' object has no attribute 'firstname'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}