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

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

  • description (str, default=None) – The description for the activity.

  • distance (class:pint.Quantity or float (meters), default=None) – The distance in meters (float) or a pint.Quantity instance.