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.datetime or string in ISO8601 format.) – Local date/time of activity start. (TZ info will be ignored)

  • elapsed_time (datetime.timedelta or int (seconds)) – The time in seconds or a datetime.timedelta object.

  • description (str) – The description for the activity.

  • distance (units.quantity.Quantity or float (meters)) – The distance in meters (float) or a units.quantity.Quantity instance.