stravalib.client.Client.create_activity¶
- Client.create_activity(name, activity_type, start_date_local, elapsed_time, description=None, distance=None)[source]¶
Create a new manual activity.
If you would like to create an activity from an uploaded GPS file, see the
stravalib.client.Client.upload_activity()method instead.- Parameters
name (str) – The name of the activity.
activity_type (str) – The activity type (case-insensitive). Possible values: ride, run, swim, workout, hike, walk, nordicski, alpineski, backcountryski, iceskate, inlineskate, kitesurf, rollerski, windsurf, workout, snowboard, snowshoe
start_date_local (
datetime.datetimeor string in ISO8601 format.) – Local date/time of activity start. (TZ info will be ignored)elapsed_time (
datetime.timedeltaor int (seconds)) – The time in seconds or adatetime.timedeltaobject.description (str) – The description for the activity.
distance (
units.quantity.Quantityor float (meters)) – The distance in meters (float) or aunits.quantity.Quantityinstance.