Model Functions and Classes#
This module contains entity classes for representing the various Strava datatypes, such as Activity, Gear, and more. These entities inherit fields from superclasses in strava_model.py, which is generated from the official Strava API specification. The classes in this module add behavior such as type enrichment, unit conversion, and lazy loading related entities from the API.
- stravalib.model.lazy_property(fn: Callable[[U], T]) T | None [source]#
Should be used to decorate the functions that return a lazily loaded entity (collection), e.g., the members of a club.
- Parameters:
fn (Callable) โ The input function that returns the lazily loaded entity (collection).
- Returns:
A lazily loaded property.
- Return type:
property
- Raises:
exc.UnboundEntity โ If the object is unbound (self.bound_client is None) or has a None ID (self.id is None).
Notes
Assumes that fn (like a regular getter property) has as single argument a reference to self, and uses one of the (bound) client methods to retrieve an entity (collection) by self.id.
- stravalib.model.check_valid_location(location: list[float] | str | None) list[float] | None [source]#
Validate a list of location xy values.
Converts a list of floating point values stored as strings to floats and returns either a list of floats or None if no location data is found.
- Parameters:
location (list of floats) โ Either a list of x,y floating point values or strings or None (The legacy serialized format is str)
- Returns:
Either returns a list of floating point values representing location x,y data or None if empty list is returned from the API.
- Return type:
list or None
- Raises:
AttributeError โ If empty list is returned, raises AttributeError
- stravalib.model.naive_datetime(value: datetime | str | bytes | int | float | None) datetime | None [source]#
Utility helper that parses a datetime value provided in JSON, string, int or other formats and returns a datetime.datetime object
- Parameters:
value (str, int) โ A value representing a date/time that may be presented in string, int, deserialized or other format.
- Returns:
A datetime object representing the datetime input value.
- Return type:
datetime.datetime
- pydantic model stravalib.model.DeprecatedSerializableMixin[source]#
Provides backward compatibility with legacy BaseEntity
Inherits from the pydantic.BaseModel class.
Show JSON schema
{ "title": "DeprecatedSerializableMixin", "description": "Provides backward compatibility with legacy BaseEntity\n\nInherits from the `pydantic.BaseModel` class.", "type": "object", "properties": {} }
- classmethod deserialize(attribute_value_mapping: dict[str, Any]) Self [source]#
Creates and returns a new object based on serialized (dict) struct.
- Parameters:
attribute_value_mapping (dict) โ A dictionary representing the serialized data.
- Returns:
DeprecatedSerializableMixin โ A new instance of the class created from the serialized data.
Deprecated
โโโ-
1.0.0 โ The deserialize() method is deprecated in favor of parse_obj() method. For more details, refer to the Pydantic documentation: https://docs.pydantic.dev/usage/models/#helper-functions
- from_dict(attribute_value_mapping: dict[str, Any]) None [source]#
Deserializes a dict into self, resetting and/or overwriting existing fields.
- Parameters:
attribute_value_mapping (dict) โ A dictionary that will be deserialized into the parent object.
Deprecated
----------
1.0.0 โ The from_dict() method is deprecated in favor of parse_obj() method. For more details, refer to the Pydantic documentation: https://docs.pydantic.dev/usage/models/#helper-functions
- to_dict() dict[str, Any] [source]#
Returns a dict representation of self
- Returns:
dict โ A dictionary containing the data from the instance.
Deprecated
โโโ- โ The to_dict() method is deprecated in favor of dict() method. For more details, refer to the Pydantic documentation: https://docs.pydantic.dev/1.10/usage/exporting_models/
- class stravalib.model.BackwardCompatibilityMixin[source]#
Mixin that intercepts attribute lookup and raises warnings or modifies return values based on what is defined in the following class attributes:
_field_conversions
Notes
The class attributes below are not yet implemented: * _deprecated_fields (TODO) * _unsupported_fields (TODO)
- pydantic model stravalib.model.BoundClientEntity[source]#
A class that bounds the Client object to the model.
Show JSON schema
{ "title": "BoundClientEntity", "description": "A class that bounds the Client object to the model.", "type": "object", "properties": { "bound_client": { "title": "Bound Client" } } }
- Fields:
- field bound_client: Any | None = None#
- pydantic model stravalib.model.LatLon[source]#
Enables backward compatibility for legacy namedtuple
Show JSON schema
{ "title": "LatLon", "description": "Enables backward compatibility for legacy namedtuple", "minItems": 2, "maxItems": 2, "type": "array", "items": { "type": "number" } }
- Fields:
__root__ (list[float])
- validator check_valid_latlng ยป all fields[source]#
Validate that Strava returned an actual lat/lon rather than an empty list. If list is empty, return None
- Parameters:
values (list) โ The list of lat/lon values returned by Strava. This list will be empty if there was no GPS associated with the activity.
- Returns:
list of lat/lon values or None
- Return type:
list or None
- classmethod deserialize(attribute_value_mapping: dict[str, Any]) Self #
Creates and returns a new object based on serialized (dict) struct.
- Parameters:
attribute_value_mapping (dict) โ A dictionary representing the serialized data.
- Returns:
DeprecatedSerializableMixin โ A new instance of the class created from the serialized data.
Deprecated
โโโ-
1.0.0 โ The deserialize() method is deprecated in favor of parse_obj() method. For more details, refer to the Pydantic documentation: https://docs.pydantic.dev/usage/models/#helper-functions
- from_dict(attribute_value_mapping: dict[str, Any]) None #
Deserializes a dict into self, resetting and/or overwriting existing fields.
- Parameters:
attribute_value_mapping (dict) โ A dictionary that will be deserialized into the parent object.
Deprecated
----------
1.0.0 โ The from_dict() method is deprecated in favor of parse_obj() method. For more details, refer to the Pydantic documentation: https://docs.pydantic.dev/usage/models/#helper-functions
- to_dict() dict[str, Any] #
Returns a dict representation of self
- Returns:
dict โ A dictionary containing the data from the instance.
Deprecated
โโโ- โ The to_dict() method is deprecated in favor of dict() method. For more details, refer to the Pydantic documentation: https://docs.pydantic.dev/1.10/usage/exporting_models/
- property lat: float#
The latitude value of an x,y coordinate.
- Returns:
The latitude value.
- Return type:
float
- property lon: float#
The longitude value of an x,y coordinate.
- Returns:
The longitude value.
- Return type:
float
- pydantic model stravalib.model.Club[source]#
Represents a single club with detailed information about the club including club name, id, location, activity types, etc.
See also
DetailedClub
A class representing a clubโs detailed information.
DeprecatedSerializableMixin
A mixin to provide backward compatibility with legacy BaseEntity.
BackwardCompatibilityMixin
A mixin to provide backward compatibility with legacy BaseDetailedEntity.
BoundClientEntity
A mixin to bind the club with a Strava API client.
Show JSON schema
{ "title": "Club", "description": "Represents a single club with detailed information about the club including\nclub name, id, location, activity types, etc.\n\nSee Also\n--------\nDetailedClub : A class representing a club's detailed information.\nDeprecatedSerializableMixin : A mixin to provide backward compatibility\n with legacy BaseEntity.\nBackwardCompatibilityMixin : A mixin to provide backward compatibility with\n legacy BaseDetailedEntity.\nBoundClientEntity : A mixin to bind the club with a Strava API client.", "type": "object", "properties": { "bound_client": { "title": "Bound Client" }, "id": { "title": "Id", "type": "integer" }, "name": { "title": "Name", "type": "string" }, "resource_state": { "title": "Resource State", "type": "integer" }, "activity_types": { "title": "Activity Types", "type": "array", "items": { "$ref": "#/definitions/ActivityType" } }, "city": { "title": "City", "type": "string" }, "country": { "title": "Country", "type": "string" }, "cover_photo": { "title": "Cover Photo", "type": "string" }, "cover_photo_small": { "title": "Cover Photo Small", "type": "string" }, "featured": { "title": "Featured", "type": "boolean" }, "member_count": { "title": "Member Count", "type": "integer" }, "private": { "title": "Private", "type": "boolean" }, "profile_medium": { "title": "Profile Medium", "type": "string" }, "sport_type": { "title": "Sport Type", "enum": [ "cycling", "running", "triathlon", "other" ], "type": "string" }, "state": { "title": "State", "type": "string" }, "url": { "title": "Url", "type": "string" }, "verified": { "title": "Verified", "type": "boolean" }, "admin": { "title": "Admin", "type": "boolean" }, "following_count": { "title": "Following Count", "type": "integer" }, "membership": { "title": "Membership", "enum": [ "member", "pending" ], "type": "string" }, "owner": { "title": "Owner", "type": "boolean" }, "profile": { "title": "Profile", "type": "string" }, "description": { "title": "Description", "type": "string" }, "club_type": { "title": "Club Type", "type": "string" } }, "definitions": { "ActivityType": { "title": "ActivityType", "enum": [ "AlpineSki", "BackcountrySki", "Canoeing", "Crossfit", "EBikeRide", "Elliptical", "Golf", "Handcycle", "Hike", "IceSkate", "InlineSkate", "Kayaking", "Kitesurf", "NordicSki", "Ride", "RockClimbing", "RollerSki", "Rowing", "Run", "Sail", "Skateboard", "Snowboard", "Snowshoe", "Soccer", "StairStepper", "StandUpPaddling", "Surfing", "Swim", "Velomobile", "VirtualRide", "VirtualRun", "Walk", "WeightTraining", "Wheelchair", "Windsurf", "Workout", "Yoga" ], "type": "string" } } }
- Fields:
- field activity_types: list[ActivityType] | None = None#
The activity types that count for a club. This takes precedence over sport_type.
- field admin: bool | None = None#
Whether the currently logged-in athlete is an administrator of this club.
- field bound_client: Any | None = None#
- field city: str | None = None#
The clubโs city.
- field club_type: str | None = None#
- field country: str | None = None#
The clubโs country.
- field cover_photo: str | None = None#
URL to a ~1185x580 pixel cover photo.
- field cover_photo_small: str | None = None#
URL to a ~360x176 pixel cover photo.
- field description: str | None = None#
- field featured: bool | None = None#
Whether the club is featured or not.
- field following_count: int | None = None#
The number of athletes in the club that the logged-in athlete follows.
- field id: int | None = None#
The clubโs unique identifier.
- field member_count: int | None = None#
The clubโs member count.
- field membership: Literal['member', 'pending'] | None = None#
The membership status of the logged-in athlete.
- field name: str | None = None#
The clubโs name.
- field owner: bool | None = None#
Whether the currently logged-in athlete is the owner of this club.
- field private: bool | None = None#
Whether the club is private.
- field profile: str | None = None#
- field profile_medium: str | None = None#
URL to a 60x60 pixel profile picture.
- field resource_state: int | None = None#
Resource state, indicates level of detail. Possible values: 1 -> โmetaโ, 2 -> โsummaryโ, 3 -> โdetailโ
- field sport_type: Literal['cycling', 'running', 'triathlon', 'other'] | None = None#
Deprecated. Prefer to use activity_types.
- field state: str | None = None#
The clubโs state or geographical region.
- field url: str | None = None#
The clubโs vanity URL.
- field verified: bool | None = None#
Whether the club is verified or not.
- classmethod deserialize(attribute_value_mapping: dict[str, Any]) Self #
Creates and returns a new object based on serialized (dict) struct.
- Parameters:
attribute_value_mapping (dict) โ A dictionary representing the serialized data.
- Returns:
DeprecatedSerializableMixin โ A new instance of the class created from the serialized data.
Deprecated
โโโ-
1.0.0 โ The deserialize() method is deprecated in favor of parse_obj() method. For more details, refer to the Pydantic documentation: https://docs.pydantic.dev/usage/models/#helper-functions
- from_dict(attribute_value_mapping: dict[str, Any]) None #
Deserializes a dict into self, resetting and/or overwriting existing fields.
- Parameters:
attribute_value_mapping (dict) โ A dictionary that will be deserialized into the parent object.
Deprecated
----------
1.0.0 โ The from_dict() method is deprecated in favor of parse_obj() method. For more details, refer to the Pydantic documentation: https://docs.pydantic.dev/usage/models/#helper-functions
- to_dict() dict[str, Any] #
Returns a dict representation of self
- Returns:
dict โ A dictionary containing the data from the instance.
Deprecated
โโโ- โ The to_dict() method is deprecated in favor of dict() method. For more details, refer to the Pydantic documentation: https://docs.pydantic.dev/1.10/usage/exporting_models/
- property activities: BatchedResultsIterator[Activity]#
Lazy property to retrieve club activities.
- Returns:
An iterator of Activity objects representing club activities.
- Return type:
Iterator
- property members: BatchedResultsIterator[Athlete]#
Lazy property to retrieve club members stored as Athlete objects.
- Returns:
A list of club members stored as Athlete objects.
- Return type:
list
- pydantic model stravalib.model.Gear[source]#
Represents a piece of gear (equipment) used in physical activities.
Show JSON schema
{ "title": "Gear", "description": "Represents a piece of gear (equipment) used in physical activities.", "type": "object", "properties": { "distance": { "title": "Distance", "type": "number" }, "id": { "title": "Id", "type": "string" }, "name": { "title": "Name", "type": "string" }, "primary": { "title": "Primary", "type": "boolean" }, "resource_state": { "title": "Resource State", "type": "integer" }, "brand_name": { "title": "Brand Name", "type": "string" }, "description": { "title": "Description", "type": "string" }, "frame_type": { "title": "Frame Type", "type": "integer" }, "model_name": { "title": "Model Name", "type": "string" } } }
- Fields:
- field brand_name: str | None = None#
The gearโs brand name.
- field description: str | None = None#
The gearโs description.
- field distance: float | None = None#
The distance logged with this gear.
- field frame_type: int | None = None#
The gearโs frame type (bike only).
- field id: str | None = None#
The gearโs unique identifier.
- field model_name: str | None = None#
The gearโs model name.
- field name: str | None = None#
The gearโs name.
- field primary: bool | None = None#
Whether this gearโs is the ownerโs default one.
- field resource_state: int | None = None#
Resource state, indicates level of detail. Possible values: 2 -> โsummaryโ, 3 -> โdetailโ
- classmethod deserialize(attribute_value_mapping: dict[str, Any]) Self #
Creates and returns a new object based on serialized (dict) struct.
- Parameters:
attribute_value_mapping (dict) โ A dictionary representing the serialized data.
- Returns:
DeprecatedSerializableMixin โ A new instance of the class created from the serialized data.
Deprecated
โโโ-
1.0.0 โ The deserialize() method is deprecated in favor of parse_obj() method. For more details, refer to the Pydantic documentation: https://docs.pydantic.dev/usage/models/#helper-functions
- from_dict(attribute_value_mapping: dict[str, Any]) None #
Deserializes a dict into self, resetting and/or overwriting existing fields.
- Parameters:
attribute_value_mapping (dict) โ A dictionary that will be deserialized into the parent object.
Deprecated
----------
1.0.0 โ The from_dict() method is deprecated in favor of parse_obj() method. For more details, refer to the Pydantic documentation: https://docs.pydantic.dev/usage/models/#helper-functions
- to_dict() dict[str, Any] #
Returns a dict representation of self
- Returns:
dict โ A dictionary containing the data from the instance.
Deprecated
โโโ- โ The to_dict() method is deprecated in favor of dict() method. For more details, refer to the Pydantic documentation: https://docs.pydantic.dev/1.10/usage/exporting_models/
- pydantic model stravalib.model.Bike[source]#
Represents a bike as a โtypeโ / using the structure of stravalib.model.Gear.
Show JSON schema
{ "title": "Bike", "description": "Represents a bike as a \"type\" / using the structure of\n`stravalib.model.Gear`.", "type": "object", "properties": { "distance": { "title": "Distance", "type": "number" }, "id": { "title": "Id", "type": "string" }, "name": { "title": "Name", "type": "string" }, "primary": { "title": "Primary", "type": "boolean" }, "resource_state": { "title": "Resource State", "type": "integer" }, "brand_name": { "title": "Brand Name", "type": "string" }, "description": { "title": "Description", "type": "string" }, "frame_type": { "title": "Frame Type", "type": "integer" }, "model_name": { "title": "Model Name", "type": "string" } } }
- Fields:
- field brand_name: str | None = None#
The gearโs brand name.
- field description: str | None = None#
The gearโs description.
- field distance: float | None = None#
The distance logged with this gear.
- field frame_type: int | None = None#
The gearโs frame type (bike only).
- field id: str | None = None#
The gearโs unique identifier.
- field model_name: str | None = None#
The gearโs model name.
- field name: str | None = None#
The gearโs name.
- field primary: bool | None = None#
Whether this gearโs is the ownerโs default one.
- field resource_state: int | None = None#
Resource state, indicates level of detail. Possible values: 2 -> โsummaryโ, 3 -> โdetailโ
- classmethod deserialize(attribute_value_mapping: dict[str, Any]) Self #
Creates and returns a new object based on serialized (dict) struct.
- Parameters:
attribute_value_mapping (dict) โ A dictionary representing the serialized data.
- Returns:
DeprecatedSerializableMixin โ A new instance of the class created from the serialized data.
Deprecated
โโโ-
1.0.0 โ The deserialize() method is deprecated in favor of parse_obj() method. For more details, refer to the Pydantic documentation: https://docs.pydantic.dev/usage/models/#helper-functions
- from_dict(attribute_value_mapping: dict[str, Any]) None #
Deserializes a dict into self, resetting and/or overwriting existing fields.
- Parameters:
attribute_value_mapping (dict) โ A dictionary that will be deserialized into the parent object.
Deprecated
----------
1.0.0 โ The from_dict() method is deprecated in favor of parse_obj() method. For more details, refer to the Pydantic documentation: https://docs.pydantic.dev/usage/models/#helper-functions
- to_dict() dict[str, Any] #
Returns a dict representation of self
- Returns:
dict โ A dictionary containing the data from the instance.
Deprecated
โโโ- โ The to_dict() method is deprecated in favor of dict() method. For more details, refer to the Pydantic documentation: https://docs.pydantic.dev/1.10/usage/exporting_models/
- pydantic model stravalib.model.Shoe[source]#
Represents a Shoes as a โtypeโ / using the structure of stravalib.model.Gear.
Show JSON schema
{ "title": "Shoe", "description": "Represents a Shoes as a \"type\" / using the structure of\n`stravalib.model.Gear`.", "type": "object", "properties": { "distance": { "title": "Distance", "type": "number" }, "id": { "title": "Id", "type": "string" }, "name": { "title": "Name", "type": "string" }, "primary": { "title": "Primary", "type": "boolean" }, "resource_state": { "title": "Resource State", "type": "integer" }, "brand_name": { "title": "Brand Name", "type": "string" }, "description": { "title": "Description", "type": "string" }, "frame_type": { "title": "Frame Type", "type": "integer" }, "model_name": { "title": "Model Name", "type": "string" } } }
- Fields:
- field brand_name: str | None = None#
The gearโs brand name.
- field description: str | None = None#
The gearโs description.
- field distance: float | None = None#
The distance logged with this gear.
- field frame_type: int | None = None#
The gearโs frame type (bike only).
- field id: str | None = None#
The gearโs unique identifier.
- field model_name: str | None = None#
The gearโs model name.
- field name: str | None = None#
The gearโs name.
- field primary: bool | None = None#
Whether this gearโs is the ownerโs default one.
- field resource_state: int | None = None#
Resource state, indicates level of detail. Possible values: 2 -> โsummaryโ, 3 -> โdetailโ
- classmethod deserialize(attribute_value_mapping: dict[str, Any]) Self #
Creates and returns a new object based on serialized (dict) struct.
- Parameters:
attribute_value_mapping (dict) โ A dictionary representing the serialized data.
- Returns:
DeprecatedSerializableMixin โ A new instance of the class created from the serialized data.
Deprecated
โโโ-
1.0.0 โ The deserialize() method is deprecated in favor of parse_obj() method. For more details, refer to the Pydantic documentation: https://docs.pydantic.dev/usage/models/#helper-functions
- from_dict(attribute_value_mapping: dict[str, Any]) None #
Deserializes a dict into self, resetting and/or overwriting existing fields.
- Parameters:
attribute_value_mapping (dict) โ A dictionary that will be deserialized into the parent object.
Deprecated
----------
1.0.0 โ The from_dict() method is deprecated in favor of parse_obj() method. For more details, refer to the Pydantic documentation: https://docs.pydantic.dev/usage/models/#helper-functions
- to_dict() dict[str, Any] #
Returns a dict representation of self
- Returns:
dict โ A dictionary containing the data from the instance.
Deprecated
โโโ- โ The to_dict() method is deprecated in favor of dict() method. For more details, refer to the Pydantic documentation: https://docs.pydantic.dev/1.10/usage/exporting_models/
- pydantic model stravalib.model.ActivityTotals[source]#
An objecting containing a set of total values for an activity including elapsed time, moving time, distance and elevation gain.
Show JSON schema
{ "title": "ActivityTotals", "description": "An objecting containing a set of total values for an activity including\nelapsed time, moving time, distance and elevation gain.", "type": "object", "properties": { "achievement_count": { "title": "Achievement Count", "type": "integer" }, "count": { "title": "Count", "type": "integer" }, "distance": { "title": "Distance", "type": "number" }, "elapsed_time": { "title": "Elapsed Time", "type": "number", "format": "time-delta" }, "elevation_gain": { "title": "Elevation Gain", "type": "number" }, "moving_time": { "title": "Moving Time", "type": "number", "format": "time-delta" } } }
- Fields:
- field achievement_count: int | None = None#
The total number of achievements of the considered activities.
- field count: int | None = None#
The number of activities considered in this total.
- field distance: float | None = None#
The total distance covered by the considered activities.
- field elapsed_time: timedelta | None = None#
The total elapsed time of the considered activities.
- field elevation_gain: float | None = None#
The total elevation gain of the considered activities.
- field moving_time: timedelta | None = None#
The total moving time of the considered activities.
- classmethod deserialize(attribute_value_mapping: dict[str, Any]) Self #
Creates and returns a new object based on serialized (dict) struct.
- Parameters:
attribute_value_mapping (dict) โ A dictionary representing the serialized data.
- Returns:
DeprecatedSerializableMixin โ A new instance of the class created from the serialized data.
Deprecated
โโโ-
1.0.0 โ The deserialize() method is deprecated in favor of parse_obj() method. For more details, refer to the Pydantic documentation: https://docs.pydantic.dev/usage/models/#helper-functions
- from_dict(attribute_value_mapping: dict[str, Any]) None #
Deserializes a dict into self, resetting and/or overwriting existing fields.
- Parameters:
attribute_value_mapping (dict) โ A dictionary that will be deserialized into the parent object.
Deprecated
----------
1.0.0 โ The from_dict() method is deprecated in favor of parse_obj() method. For more details, refer to the Pydantic documentation: https://docs.pydantic.dev/usage/models/#helper-functions
- to_dict() dict[str, Any] #
Returns a dict representation of self
- Returns:
dict โ A dictionary containing the data from the instance.
Deprecated
โโโ- โ The to_dict() method is deprecated in favor of dict() method. For more details, refer to the Pydantic documentation: https://docs.pydantic.dev/1.10/usage/exporting_models/
- pydantic model stravalib.model.AthleteStats[source]#
Summary totals for rides, runs and swims, as shown in an athleteโs public profile. Non-public activities are not counted for these totals.
Show JSON schema
{ "title": "AthleteStats", "description": "Summary totals for rides, runs and swims, as shown in an athlete's public\nprofile. Non-public activities are not counted for these totals.", "type": "object", "properties": { "all_ride_totals": { "$ref": "#/definitions/ActivityTotals" }, "all_run_totals": { "$ref": "#/definitions/ActivityTotals" }, "all_swim_totals": { "$ref": "#/definitions/ActivityTotals" }, "biggest_climb_elevation_gain": { "title": "Biggest Climb Elevation Gain", "type": "number" }, "biggest_ride_distance": { "title": "Biggest Ride Distance", "type": "number" }, "recent_ride_totals": { "$ref": "#/definitions/ActivityTotals" }, "recent_run_totals": { "$ref": "#/definitions/ActivityTotals" }, "recent_swim_totals": { "$ref": "#/definitions/ActivityTotals" }, "ytd_ride_totals": { "$ref": "#/definitions/ActivityTotals" }, "ytd_run_totals": { "$ref": "#/definitions/ActivityTotals" }, "ytd_swim_totals": { "$ref": "#/definitions/ActivityTotals" } }, "definitions": { "ActivityTotals": { "title": "ActivityTotals", "description": "An objecting containing a set of total values for an activity including\nelapsed time, moving time, distance and elevation gain.", "type": "object", "properties": { "achievement_count": { "title": "Achievement Count", "type": "integer" }, "count": { "title": "Count", "type": "integer" }, "distance": { "title": "Distance", "type": "number" }, "elapsed_time": { "title": "Elapsed Time", "type": "number", "format": "time-delta" }, "elevation_gain": { "title": "Elevation Gain", "type": "number" }, "moving_time": { "title": "Moving Time", "type": "number", "format": "time-delta" } } } } }
- Fields:
- field all_ride_totals: ActivityTotals | None = None#
The all time ride stats for the athlete.
- field all_run_totals: ActivityTotals | None = None#
The all time run stats for the athlete.
- field all_swim_totals: ActivityTotals | None = None#
The all time swim stats for the athlete.
- field biggest_climb_elevation_gain: float | None = None#
The highest climb ridden by the athlete.
- field biggest_ride_distance: float | None = None#
The longest distance ridden by the athlete.
- field recent_ride_totals: ActivityTotals | None = None#
The recent (last 4 weeks) ride stats for the athlete.
- field recent_run_totals: ActivityTotals | None = None#
The recent (last 4 weeks) run stats for the athlete.
- field recent_swim_totals: ActivityTotals | None = None#
The recent (last 4 weeks) swim stats for the athlete.
- field ytd_ride_totals: ActivityTotals | None = None#
The year to date ride stats for the athlete.
- field ytd_run_totals: ActivityTotals | None = None#
The year to date run stats for the athlete.
- field ytd_swim_totals: ActivityTotals | None = None#
The year to date swim stats for the athlete.
- classmethod deserialize(attribute_value_mapping: dict[str, Any]) Self #
Creates and returns a new object based on serialized (dict) struct.
- Parameters:
attribute_value_mapping (dict) โ A dictionary representing the serialized data.
- Returns:
DeprecatedSerializableMixin โ A new instance of the class created from the serialized data.
Deprecated
โโโ-
1.0.0 โ The deserialize() method is deprecated in favor of parse_obj() method. For more details, refer to the Pydantic documentation: https://docs.pydantic.dev/usage/models/#helper-functions
- from_dict(attribute_value_mapping: dict[str, Any]) None #
Deserializes a dict into self, resetting and/or overwriting existing fields.
- Parameters:
attribute_value_mapping (dict) โ A dictionary that will be deserialized into the parent object.
Deprecated
----------
1.0.0 โ The from_dict() method is deprecated in favor of parse_obj() method. For more details, refer to the Pydantic documentation: https://docs.pydantic.dev/usage/models/#helper-functions
- to_dict() dict[str, Any] #
Returns a dict representation of self
- Returns:
dict โ A dictionary containing the data from the instance.
Deprecated
โโโ- โ The to_dict() method is deprecated in favor of dict() method. For more details, refer to the Pydantic documentation: https://docs.pydantic.dev/1.10/usage/exporting_models/
- pydantic model stravalib.model.Athlete[source]#
Represents high level athlete information including their name, email, clubs they belong to, bikes, shoes, etc.
Notes
Also provides access to detailed athlete stats upon request. Many attributes in this object are undocumented by Strava and could be modified at any time.
Show JSON schema
{ "title": "Athlete", "description": "Represents high level athlete information including\ntheir name, email, clubs they belong to, bikes, shoes, etc.\n\nNotes\n------\nAlso provides access to detailed athlete stats upon request.\nMany attributes in this object are undocumented by Strava and could be\nmodified at any time.", "type": "object", "properties": { "bound_client": { "title": "Bound Client" }, "id": { "title": "Id", "type": "integer" }, "city": { "title": "City", "type": "string" }, "country": { "title": "Country", "type": "string" }, "created_at": { "title": "Created At", "type": "string", "format": "date-time" }, "firstname": { "title": "Firstname", "type": "string" }, "lastname": { "title": "Lastname", "type": "string" }, "premium": { "title": "Premium", "type": "boolean" }, "profile": { "title": "Profile", "type": "string" }, "profile_medium": { "title": "Profile Medium", "type": "string" }, "resource_state": { "title": "Resource State", "type": "integer" }, "sex": { "title": "Sex", "enum": [ "M", "F" ], "type": "string" }, "state": { "title": "State", "type": "string" }, "summit": { "title": "Summit", "type": "boolean" }, "updated_at": { "title": "Updated At", "type": "string", "format": "date-time" }, "bikes": { "title": "Bikes", "type": "array", "items": { "$ref": "#/definitions/SummaryGear" } }, "clubs": { "title": "Clubs", "type": "array", "items": { "$ref": "#/definitions/SummaryClub" } }, "follower_count": { "title": "Follower Count", "type": "integer" }, "friend_count": { "title": "Friend Count", "type": "integer" }, "ftp": { "title": "Ftp", "type": "integer" }, "measurement_preference": { "title": "Measurement Preference", "enum": [ "feet", "meters" ], "type": "string" }, "shoes": { "title": "Shoes", "type": "array", "items": { "$ref": "#/definitions/SummaryGear" } }, "weight": { "title": "Weight", "type": "number" }, "is_authenticated": { "title": "Is Authenticated", "type": "boolean" }, "athlete_type": { "title": "Athlete Type", "enum": [ "cyclist", "runner" ], "type": "string" }, "friend": { "title": "Friend", "type": "string" }, "follower": { "title": "Follower", "type": "string" }, "approve_followers": { "title": "Approve Followers", "type": "boolean" }, "badge_type_id": { "title": "Badge Type Id", "type": "integer" }, "mutual_friend_count": { "title": "Mutual Friend Count", "type": "integer" }, "date_preference": { "title": "Date Preference", "type": "string" }, "email": { "title": "Email", "type": "string" }, "super_user": { "title": "Super User", "type": "boolean" }, "email_language": { "title": "Email Language", "type": "string" }, "max_heartrate": { "title": "Max Heartrate", "type": "number" }, "username": { "title": "Username", "type": "string" }, "description": { "title": "Description", "type": "string" }, "instagram_username": { "title": "Instagram Username", "type": "string" }, "offer_in_app_payment": { "title": "Offer In App Payment", "type": "boolean" }, "global_privacy": { "title": "Global Privacy", "type": "boolean" }, "receive_newsletter": { "title": "Receive Newsletter", "type": "boolean" }, "email_kom_lost": { "title": "Email Kom Lost", "type": "boolean" }, "dateofbirth": { "title": "Dateofbirth", "type": "string", "format": "date" }, "facebook_sharing_enabled": { "title": "Facebook Sharing Enabled", "type": "boolean" }, "profile_original": { "title": "Profile Original", "type": "string" }, "premium_expiration_date": { "title": "Premium Expiration Date", "type": "integer" }, "email_send_follower_notices": { "title": "Email Send Follower Notices", "type": "boolean" }, "plan": { "title": "Plan", "type": "string" }, "agreed_to_terms": { "title": "Agreed To Terms", "type": "string" }, "follower_request_count": { "title": "Follower Request Count", "type": "integer" }, "email_facebook_twitter_friend_joins": { "title": "Email Facebook Twitter Friend Joins", "type": "boolean" }, "receive_kudos_emails": { "title": "Receive Kudos Emails", "type": "boolean" }, "receive_follower_feed_emails": { "title": "Receive Follower Feed Emails", "type": "boolean" }, "receive_comment_emails": { "title": "Receive Comment Emails", "type": "boolean" }, "sample_race_distance": { "title": "Sample Race Distance", "type": "integer" }, "sample_race_time": { "title": "Sample Race Time", "type": "integer" }, "membership": { "title": "Membership", "type": "string" }, "admin": { "title": "Admin", "type": "boolean" }, "owner": { "title": "Owner", "type": "boolean" }, "subscription_permissions": { "title": "Subscription Permissions", "type": "array", "items": { "type": "boolean" } } }, "definitions": { "SummaryGear": { "title": "SummaryGear", "type": "object", "properties": { "distance": { "title": "Distance", "type": "number" }, "id": { "title": "Id", "type": "string" }, "name": { "title": "Name", "type": "string" }, "primary": { "title": "Primary", "type": "boolean" }, "resource_state": { "title": "Resource State", "type": "integer" } } }, "ActivityType": { "title": "ActivityType", "enum": [ "AlpineSki", "BackcountrySki", "Canoeing", "Crossfit", "EBikeRide", "Elliptical", "Golf", "Handcycle", "Hike", "IceSkate", "InlineSkate", "Kayaking", "Kitesurf", "NordicSki", "Ride", "RockClimbing", "RollerSki", "Rowing", "Run", "Sail", "Skateboard", "Snowboard", "Snowshoe", "Soccer", "StairStepper", "StandUpPaddling", "Surfing", "Swim", "Velomobile", "VirtualRide", "VirtualRun", "Walk", "WeightTraining", "Wheelchair", "Windsurf", "Workout", "Yoga" ], "type": "string" }, "SummaryClub": { "title": "SummaryClub", "type": "object", "properties": { "id": { "title": "Id", "type": "integer" }, "name": { "title": "Name", "type": "string" }, "resource_state": { "title": "Resource State", "type": "integer" }, "activity_types": { "title": "Activity Types", "type": "array", "items": { "$ref": "#/definitions/ActivityType" } }, "city": { "title": "City", "type": "string" }, "country": { "title": "Country", "type": "string" }, "cover_photo": { "title": "Cover Photo", "type": "string" }, "cover_photo_small": { "title": "Cover Photo Small", "type": "string" }, "featured": { "title": "Featured", "type": "boolean" }, "member_count": { "title": "Member Count", "type": "integer" }, "private": { "title": "Private", "type": "boolean" }, "profile_medium": { "title": "Profile Medium", "type": "string" }, "sport_type": { "title": "Sport Type", "enum": [ "cycling", "running", "triathlon", "other" ], "type": "string" }, "state": { "title": "State", "type": "string" }, "url": { "title": "Url", "type": "string" }, "verified": { "title": "Verified", "type": "boolean" } } } } }
- Fields:
- Validators:
- field admin: bool | None = None#
- field agreed_to_terms: str | None = None#
- field approve_followers: bool | None = None#
- field athlete_type: Literal['cyclist', 'runner'] | None = None#
- Validated by:
- field badge_type_id: int | None = None#
- field bikes: list[SummaryGear] | None = None#
The athleteโs bikes.
- field bound_client: Any | None = None#
- field city: str | None = None#
The athleteโs city.
- field clubs: list[SummaryClub] | None = None#
The athleteโs clubs.
- field country: str | None = None#
The athleteโs country.
- field created_at: datetime | None = None#
The time at which the athlete was created.
- field date_preference: str | None = None#
- field dateofbirth: date | None = None#
- field description: str | None = None#
- field email: str | None = None#
- field email_facebook_twitter_friend_joins: bool | None = None#
- field email_kom_lost: bool | None = None#
- field email_language: str | None = None#
- field email_send_follower_notices: bool | None = None#
- field facebook_sharing_enabled: bool | None = None#
- field firstname: str | None = None#
The athleteโs first name.
- field follower: str | None = None#
- field follower_count: int | None = None#
The athleteโs follower count.
- field follower_request_count: int | None = None#
- field friend: str | None = None#
- field friend_count: int | None = None#
The athleteโs friend count.
- field ftp: int | None = None#
The athleteโs FTP (Functional Threshold Power).
- field global_privacy: bool | None = None#
- field id: int | None = None#
The unique identifier of the athlete
- field instagram_username: str | None = None#
- field is_authenticated: bool | None = None#
- field lastname: str | None = None#
The athleteโs last name.
- field max_heartrate: float | None = None#
- field measurement_preference: Literal['feet', 'meters'] | None = None#
The athleteโs preferred unit system.
- field membership: str | None = None#
- field mutual_friend_count: int | None = None#
- field offer_in_app_payment: bool | None = None#
- field owner: bool | None = None#
- field plan: str | None = None#
Deprecated. Use summit field instead. Whether the athlete has any Summit subscription.
- field profile: str | None = None#
URL to a 124x124 pixel profile picture.
- field profile_medium: str | None = None#
URL to a 62x62 pixel profile picture.
- field profile_original: str | None = None#
- field receive_comment_emails: bool | None = None#
- field receive_follower_feed_emails: bool | None = None#
- field receive_kudos_emails: bool | None = None#
- field receive_newsletter: bool | None = None#
- field resource_state: int | None = None#
Resource state, indicates level of detail. Possible values: 1 -> โmetaโ, 2 -> โsummaryโ, 3 -> โdetailโ
- field sample_race_distance: int | None = None#
- field sample_race_time: int | None = None#
- field sex: Literal['M', 'F'] | None = None#
The athleteโs sex.
- field shoes: list[SummaryGear] | None = None#
The athleteโs shoes.
- field state: str | None = None#
The athleteโs state or geographical region.
- field subscription_permissions: list[bool] | None = None#
- field summit: bool | None = None#
Whether the athlete has any Summit subscription.
- field super_user: bool | None = None#
- field updated_at: datetime | None = None#
The time at which the athlete was last updated.
- field username: str | None = None#
- field weight: float | None = None#
The athleteโs weight.
- classmethod deserialize(attribute_value_mapping: dict[str, Any]) Self #
Creates and returns a new object based on serialized (dict) struct.
- Parameters:
attribute_value_mapping (dict) โ A dictionary representing the serialized data.
- Returns:
DeprecatedSerializableMixin โ A new instance of the class created from the serialized data.
Deprecated
โโโ-
1.0.0 โ The deserialize() method is deprecated in favor of parse_obj() method. For more details, refer to the Pydantic documentation: https://docs.pydantic.dev/usage/models/#helper-functions
- from_dict(attribute_value_mapping: dict[str, Any]) None #
Deserializes a dict into self, resetting and/or overwriting existing fields.
- Parameters:
attribute_value_mapping (dict) โ A dictionary that will be deserialized into the parent object.
Deprecated
----------
1.0.0 โ The from_dict() method is deprecated in favor of parse_obj() method. For more details, refer to the Pydantic documentation: https://docs.pydantic.dev/usage/models/#helper-functions
- is_authenticated_athlete() bool [source]#
Check if the athlete is authenticated
- Returns:
Whether the athlete is the authenticated athlete (or not).
- Return type:
bool
- to_dict() dict[str, Any] #
Returns a dict representation of self
- Returns:
dict โ A dictionary containing the data from the instance.
Deprecated
โโโ- โ The to_dict() method is deprecated in favor of dict() method. For more details, refer to the Pydantic documentation: https://docs.pydantic.dev/1.10/usage/exporting_models/
- validator to_str_representation ยป athlete_type[source]#
Replaces legacy โChoicesAttributeโ class.
- Parameters:
raw_type (int) โ The raw integer representing the athlete type.
- Returns:
The string representation of the athlete type.
- Return type:
str
- property authenticated_athlete: Athlete#
Returns an Athlete object containing Strava account data for the (authenticated) athlete.
- Returns:
The detailed information of the authenticated athlete.
- Return type:
- property stats: AthleteStats#
Grabs statistics for an (authenticated) athlete.
- Return type:
Associated
stravalib.model.AthleteStats
- Raises:
missing. โ
- pydantic model stravalib.model.ActivityComment[source]#
A class representing a comment on an activity.
This class overrides the athlete attribute to be of type
Athlete
instead ofSummaryAthlete
.Show JSON schema
{ "title": "ActivityComment", "description": "A class representing a comment on an activity.\n\nThis class overrides the `athlete` attribute to be of type :class:`Athlete`\ninstead of :class:`SummaryAthlete`.\n\nAttributes\n----------\nathlete : Athlete, optional\n The athlete associated with the comment.", "type": "object", "properties": { "activity_id": { "title": "Activity Id", "type": "integer" }, "athlete": { "$ref": "#/definitions/Athlete" }, "created_at": { "title": "Created At", "type": "string", "format": "date-time" }, "id": { "title": "Id", "type": "integer" }, "text": { "title": "Text", "type": "string" } }, "definitions": { "SummaryGear": { "title": "SummaryGear", "type": "object", "properties": { "distance": { "title": "Distance", "type": "number" }, "id": { "title": "Id", "type": "string" }, "name": { "title": "Name", "type": "string" }, "primary": { "title": "Primary", "type": "boolean" }, "resource_state": { "title": "Resource State", "type": "integer" } } }, "ActivityType": { "title": "ActivityType", "enum": [ "AlpineSki", "BackcountrySki", "Canoeing", "Crossfit", "EBikeRide", "Elliptical", "Golf", "Handcycle", "Hike", "IceSkate", "InlineSkate", "Kayaking", "Kitesurf", "NordicSki", "Ride", "RockClimbing", "RollerSki", "Rowing", "Run", "Sail", "Skateboard", "Snowboard", "Snowshoe", "Soccer", "StairStepper", "StandUpPaddling", "Surfing", "Swim", "Velomobile", "VirtualRide", "VirtualRun", "Walk", "WeightTraining", "Wheelchair", "Windsurf", "Workout", "Yoga" ], "type": "string" }, "SummaryClub": { "title": "SummaryClub", "type": "object", "properties": { "id": { "title": "Id", "type": "integer" }, "name": { "title": "Name", "type": "string" }, "resource_state": { "title": "Resource State", "type": "integer" }, "activity_types": { "title": "Activity Types", "type": "array", "items": { "$ref": "#/definitions/ActivityType" } }, "city": { "title": "City", "type": "string" }, "country": { "title": "Country", "type": "string" }, "cover_photo": { "title": "Cover Photo", "type": "string" }, "cover_photo_small": { "title": "Cover Photo Small", "type": "string" }, "featured": { "title": "Featured", "type": "boolean" }, "member_count": { "title": "Member Count", "type": "integer" }, "private": { "title": "Private", "type": "boolean" }, "profile_medium": { "title": "Profile Medium", "type": "string" }, "sport_type": { "title": "Sport Type", "enum": [ "cycling", "running", "triathlon", "other" ], "type": "string" }, "state": { "title": "State", "type": "string" }, "url": { "title": "Url", "type": "string" }, "verified": { "title": "Verified", "type": "boolean" } } }, "Athlete": { "title": "Athlete", "description": "Represents high level athlete information including\ntheir name, email, clubs they belong to, bikes, shoes, etc.\n\nNotes\n------\nAlso provides access to detailed athlete stats upon request.\nMany attributes in this object are undocumented by Strava and could be\nmodified at any time.", "type": "object", "properties": { "bound_client": { "title": "Bound Client" }, "id": { "title": "Id", "type": "integer" }, "city": { "title": "City", "type": "string" }, "country": { "title": "Country", "type": "string" }, "created_at": { "title": "Created At", "type": "string", "format": "date-time" }, "firstname": { "title": "Firstname", "type": "string" }, "lastname": { "title": "Lastname", "type": "string" }, "premium": { "title": "Premium", "type": "boolean" }, "profile": { "title": "Profile", "type": "string" }, "profile_medium": { "title": "Profile Medium", "type": "string" }, "resource_state": { "title": "Resource State", "type": "integer" }, "sex": { "title": "Sex", "enum": [ "M", "F" ], "type": "string" }, "state": { "title": "State", "type": "string" }, "summit": { "title": "Summit", "type": "boolean" }, "updated_at": { "title": "Updated At", "type": "string", "format": "date-time" }, "bikes": { "title": "Bikes", "type": "array", "items": { "$ref": "#/definitions/SummaryGear" } }, "clubs": { "title": "Clubs", "type": "array", "items": { "$ref": "#/definitions/SummaryClub" } }, "follower_count": { "title": "Follower Count", "type": "integer" }, "friend_count": { "title": "Friend Count", "type": "integer" }, "ftp": { "title": "Ftp", "type": "integer" }, "measurement_preference": { "title": "Measurement Preference", "enum": [ "feet", "meters" ], "type": "string" }, "shoes": { "title": "Shoes", "type": "array", "items": { "$ref": "#/definitions/SummaryGear" } }, "weight": { "title": "Weight", "type": "number" }, "is_authenticated": { "title": "Is Authenticated", "type": "boolean" }, "athlete_type": { "title": "Athlete Type", "enum": [ "cyclist", "runner" ], "type": "string" }, "friend": { "title": "Friend", "type": "string" }, "follower": { "title": "Follower", "type": "string" }, "approve_followers": { "title": "Approve Followers", "type": "boolean" }, "badge_type_id": { "title": "Badge Type Id", "type": "integer" }, "mutual_friend_count": { "title": "Mutual Friend Count", "type": "integer" }, "date_preference": { "title": "Date Preference", "type": "string" }, "email": { "title": "Email", "type": "string" }, "super_user": { "title": "Super User", "type": "boolean" }, "email_language": { "title": "Email Language", "type": "string" }, "max_heartrate": { "title": "Max Heartrate", "type": "number" }, "username": { "title": "Username", "type": "string" }, "description": { "title": "Description", "type": "string" }, "instagram_username": { "title": "Instagram Username", "type": "string" }, "offer_in_app_payment": { "title": "Offer In App Payment", "type": "boolean" }, "global_privacy": { "title": "Global Privacy", "type": "boolean" }, "receive_newsletter": { "title": "Receive Newsletter", "type": "boolean" }, "email_kom_lost": { "title": "Email Kom Lost", "type": "boolean" }, "dateofbirth": { "title": "Dateofbirth", "type": "string", "format": "date" }, "facebook_sharing_enabled": { "title": "Facebook Sharing Enabled", "type": "boolean" }, "profile_original": { "title": "Profile Original", "type": "string" }, "premium_expiration_date": { "title": "Premium Expiration Date", "type": "integer" }, "email_send_follower_notices": { "title": "Email Send Follower Notices", "type": "boolean" }, "plan": { "title": "Plan", "type": "string" }, "agreed_to_terms": { "title": "Agreed To Terms", "type": "string" }, "follower_request_count": { "title": "Follower Request Count", "type": "integer" }, "email_facebook_twitter_friend_joins": { "title": "Email Facebook Twitter Friend Joins", "type": "boolean" }, "receive_kudos_emails": { "title": "Receive Kudos Emails", "type": "boolean" }, "receive_follower_feed_emails": { "title": "Receive Follower Feed Emails", "type": "boolean" }, "receive_comment_emails": { "title": "Receive Comment Emails", "type": "boolean" }, "sample_race_distance": { "title": "Sample Race Distance", "type": "integer" }, "sample_race_time": { "title": "Sample Race Time", "type": "integer" }, "membership": { "title": "Membership", "type": "string" }, "admin": { "title": "Admin", "type": "boolean" }, "owner": { "title": "Owner", "type": "boolean" }, "subscription_permissions": { "title": "Subscription Permissions", "type": "array", "items": { "type": "boolean" } } } } } }
- Fields:
- field activity_id: int | None = None#
The identifier of the activity this comment is related to
- field created_at: datetime | None = None#
The time at which this comment was created.
- field id: int | None = None#
The unique identifier of this comment
- field text: str | None = None#
The content of the comment
- pydantic model stravalib.model.ActivityPhotoPrimary[source]#
Represents the primary photo for an activity.
- use_primary_photo#
Indicates whether the photo is used as the primary photo.
- Type:
bool, optional
Notes
Attributes for activity photos are currently undocumented.
Show JSON schema
{ "title": "ActivityPhotoPrimary", "description": "Represents the primary photo for an activity.\n\nAttributes\n----------\nuse_primary_photo : bool, optional\n Indicates whether the photo is used as the primary photo.\n\nNotes\n-----\nAttributes for activity photos are currently undocumented.", "type": "object", "properties": { "id": { "title": "Id", "type": "integer" }, "source": { "title": "Source", "type": "integer" }, "unique_id": { "title": "Unique Id", "type": "string" }, "urls": { "title": "Urls", "type": "object", "additionalProperties": { "type": "string" } }, "use_primary_photo": { "title": "Use Primary Photo", "type": "boolean" } } }
- Fields:
- field id: int | None = None#
- field source: int | None = None#
- field unique_id: str | None = None#
- field urls: dict[str, str] | None = None#
- field use_primary_photo: bool | None = None#
- pydantic model stravalib.model.ActivityPhotoMeta[source]#
Represents the metadata of photos returned with the activity.
Not to be confused with the fully loaded photos for an activity.
- primary#
The primary photo for the activity.
- Type:
ActivityPhotoPrimary, optional
- use_primary_photo#
Indicates whether the primary photo is used. Not currently documented by Strava.
- Type:
bool, optional
Notes
Undocumented attributes could be changed by Strava at any time.
Show JSON schema
{ "title": "ActivityPhotoMeta", "description": "Represents the metadata of photos returned with the activity.\n\nNot to be confused with the fully loaded photos for an activity.\n\nAttributes\n----------\nprimary : ActivityPhotoPrimary, optional\n The primary photo for the activity.\nuse_primary_photo : bool, optional\n Indicates whether the primary photo is used. Not currently documented\n by Strava.\n\nNotes\n-----\nUndocumented attributes could be changed by Strava at any time.", "type": "object", "properties": { "count": { "title": "Count", "type": "integer" }, "primary": { "$ref": "#/definitions/ActivityPhotoPrimary" }, "use_primary_photo": { "title": "Use Primary Photo", "type": "boolean" } }, "definitions": { "ActivityPhotoPrimary": { "title": "ActivityPhotoPrimary", "description": "Represents the primary photo for an activity.\n\nAttributes\n----------\nuse_primary_photo : bool, optional\n Indicates whether the photo is used as the primary photo.\n\nNotes\n-----\nAttributes for activity photos are currently undocumented.", "type": "object", "properties": { "id": { "title": "Id", "type": "integer" }, "source": { "title": "Source", "type": "integer" }, "unique_id": { "title": "Unique Id", "type": "string" }, "urls": { "title": "Urls", "type": "object", "additionalProperties": { "type": "string" } }, "use_primary_photo": { "title": "Use Primary Photo", "type": "boolean" } } } } }
- Fields:
- field count: int | None = None#
The number of photos
- field primary: ActivityPhotoPrimary | None = None#
- field use_primary_photo: bool | None = None#
- pydantic model stravalib.model.ActivityPhoto[source]#
A full photo record attached to an activity.
Notes
Warning: this entity is undocumented by Strava and there is no official endpoint to retrieve it
Show JSON schema
{ "title": "ActivityPhoto", "description": "A full photo record attached to an activity.\n\nNotes\n-----\nWarning: this entity is undocumented by Strava and there is no official\nendpoint to retrieve it", "type": "object", "properties": { "athlete_id": { "title": "Athlete Id", "type": "integer" }, "activity_id": { "title": "Activity Id", "type": "integer" }, "activity_name": { "title": "Activity Name", "type": "string" }, "ref": { "title": "Ref", "type": "string" }, "uid": { "title": "Uid", "type": "string" }, "unique_id": { "title": "Unique Id", "type": "string" }, "caption": { "title": "Caption", "type": "string" }, "type": { "title": "Type", "type": "string" }, "uploaded_at": { "title": "Uploaded At", "type": "string", "format": "date-time" }, "created_at": { "title": "Created At", "type": "string", "format": "date-time" }, "created_at_local": { "title": "Created At Local", "type": "string", "format": "date-time" }, "location": { "$ref": "#/definitions/LatLon" }, "urls": { "title": "Urls", "type": "object", "additionalProperties": { "type": "string" } }, "sizes": { "title": "Sizes", "type": "object", "additionalProperties": { "type": "array", "items": { "type": "integer" } } }, "post_id": { "title": "Post Id", "type": "integer" }, "default_photo": { "title": "Default Photo", "type": "boolean" }, "source": { "title": "Source", "type": "integer" } }, "definitions": { "LatLon": { "title": "LatLon", "description": "Enables backward compatibility for legacy namedtuple", "minItems": 2, "maxItems": 2, "type": "array", "items": { "type": "number" } } } }
- Fields:
- Validators:
- field activity_id: int | None = None#
- field activity_name: str | None = None#
- field athlete_id: int | None = None#
- field created_at: datetime | None = None#
- field created_at_local: datetime | None = None#
- Validated by:
- field default_photo: bool | None = None#
- field post_id: int | None = None#
- field ref: str | None = None#
- field sizes: dict[str, list[int]] | None = None#
- field source: int | None = None#
- field type: str | None = None#
- field uid: str | None = None#
- field unique_id: str | None = None#
- field uploaded_at: datetime | None = None#
- field urls: dict[str, str] | None = None#
- classmethod deserialize(attribute_value_mapping: dict[str, Any]) Self #
Creates and returns a new object based on serialized (dict) struct.
- Parameters:
attribute_value_mapping (dict) โ A dictionary representing the serialized data.
- Returns:
DeprecatedSerializableMixin โ A new instance of the class created from the serialized data.
Deprecated
โโโ-
1.0.0 โ The deserialize() method is deprecated in favor of parse_obj() method. For more details, refer to the Pydantic documentation: https://docs.pydantic.dev/usage/models/#helper-functions
- from_dict(attribute_value_mapping: dict[str, Any]) None #
Deserializes a dict into self, resetting and/or overwriting existing fields.
- Parameters:
attribute_value_mapping (dict) โ A dictionary that will be deserialized into the parent object.
Deprecated
----------
1.0.0 โ The from_dict() method is deprecated in favor of parse_obj() method. For more details, refer to the Pydantic documentation: https://docs.pydantic.dev/usage/models/#helper-functions
- to_dict() dict[str, Any] #
Returns a dict representation of self
- Returns:
dict โ A dictionary containing the data from the instance.
Deprecated
โโโ- โ The to_dict() method is deprecated in favor of dict() method. For more details, refer to the Pydantic documentation: https://docs.pydantic.dev/1.10/usage/exporting_models/
- pydantic model stravalib.model.ActivityKudos[source]#
Represents kudos an athlete received on an activity.
Notes
Activity kudos are a subset of athlete properties.
Show JSON schema
{ "title": "ActivityKudos", "description": "Represents kudos an athlete received on an activity.\n\nNotes\n-----\nActivity kudos are a subset of athlete properties.", "type": "object", "properties": { "bound_client": { "title": "Bound Client" }, "id": { "title": "Id", "type": "integer" }, "city": { "title": "City", "type": "string" }, "country": { "title": "Country", "type": "string" }, "created_at": { "title": "Created At", "type": "string", "format": "date-time" }, "firstname": { "title": "Firstname", "type": "string" }, "lastname": { "title": "Lastname", "type": "string" }, "premium": { "title": "Premium", "type": "boolean" }, "profile": { "title": "Profile", "type": "string" }, "profile_medium": { "title": "Profile Medium", "type": "string" }, "resource_state": { "title": "Resource State", "type": "integer" }, "sex": { "title": "Sex", "enum": [ "M", "F" ], "type": "string" }, "state": { "title": "State", "type": "string" }, "summit": { "title": "Summit", "type": "boolean" }, "updated_at": { "title": "Updated At", "type": "string", "format": "date-time" }, "bikes": { "title": "Bikes", "type": "array", "items": { "$ref": "#/definitions/SummaryGear" } }, "clubs": { "title": "Clubs", "type": "array", "items": { "$ref": "#/definitions/SummaryClub" } }, "follower_count": { "title": "Follower Count", "type": "integer" }, "friend_count": { "title": "Friend Count", "type": "integer" }, "ftp": { "title": "Ftp", "type": "integer" }, "measurement_preference": { "title": "Measurement Preference", "enum": [ "feet", "meters" ], "type": "string" }, "shoes": { "title": "Shoes", "type": "array", "items": { "$ref": "#/definitions/SummaryGear" } }, "weight": { "title": "Weight", "type": "number" }, "is_authenticated": { "title": "Is Authenticated", "type": "boolean" }, "athlete_type": { "title": "Athlete Type", "enum": [ "cyclist", "runner" ], "type": "string" }, "friend": { "title": "Friend", "type": "string" }, "follower": { "title": "Follower", "type": "string" }, "approve_followers": { "title": "Approve Followers", "type": "boolean" }, "badge_type_id": { "title": "Badge Type Id", "type": "integer" }, "mutual_friend_count": { "title": "Mutual Friend Count", "type": "integer" }, "date_preference": { "title": "Date Preference", "type": "string" }, "email": { "title": "Email", "type": "string" }, "super_user": { "title": "Super User", "type": "boolean" }, "email_language": { "title": "Email Language", "type": "string" }, "max_heartrate": { "title": "Max Heartrate", "type": "number" }, "username": { "title": "Username", "type": "string" }, "description": { "title": "Description", "type": "string" }, "instagram_username": { "title": "Instagram Username", "type": "string" }, "offer_in_app_payment": { "title": "Offer In App Payment", "type": "boolean" }, "global_privacy": { "title": "Global Privacy", "type": "boolean" }, "receive_newsletter": { "title": "Receive Newsletter", "type": "boolean" }, "email_kom_lost": { "title": "Email Kom Lost", "type": "boolean" }, "dateofbirth": { "title": "Dateofbirth", "type": "string", "format": "date" }, "facebook_sharing_enabled": { "title": "Facebook Sharing Enabled", "type": "boolean" }, "profile_original": { "title": "Profile Original", "type": "string" }, "premium_expiration_date": { "title": "Premium Expiration Date", "type": "integer" }, "email_send_follower_notices": { "title": "Email Send Follower Notices", "type": "boolean" }, "plan": { "title": "Plan", "type": "string" }, "agreed_to_terms": { "title": "Agreed To Terms", "type": "string" }, "follower_request_count": { "title": "Follower Request Count", "type": "integer" }, "email_facebook_twitter_friend_joins": { "title": "Email Facebook Twitter Friend Joins", "type": "boolean" }, "receive_kudos_emails": { "title": "Receive Kudos Emails", "type": "boolean" }, "receive_follower_feed_emails": { "title": "Receive Follower Feed Emails", "type": "boolean" }, "receive_comment_emails": { "title": "Receive Comment Emails", "type": "boolean" }, "sample_race_distance": { "title": "Sample Race Distance", "type": "integer" }, "sample_race_time": { "title": "Sample Race Time", "type": "integer" }, "membership": { "title": "Membership", "type": "string" }, "admin": { "title": "Admin", "type": "boolean" }, "owner": { "title": "Owner", "type": "boolean" }, "subscription_permissions": { "title": "Subscription Permissions", "type": "array", "items": { "type": "boolean" } } }, "definitions": { "SummaryGear": { "title": "SummaryGear", "type": "object", "properties": { "distance": { "title": "Distance", "type": "number" }, "id": { "title": "Id", "type": "string" }, "name": { "title": "Name", "type": "string" }, "primary": { "title": "Primary", "type": "boolean" }, "resource_state": { "title": "Resource State", "type": "integer" } } }, "ActivityType": { "title": "ActivityType", "enum": [ "AlpineSki", "BackcountrySki", "Canoeing", "Crossfit", "EBikeRide", "Elliptical", "Golf", "Handcycle", "Hike", "IceSkate", "InlineSkate", "Kayaking", "Kitesurf", "NordicSki", "Ride", "RockClimbing", "RollerSki", "Rowing", "Run", "Sail", "Skateboard", "Snowboard", "Snowshoe", "Soccer", "StairStepper", "StandUpPaddling", "Surfing", "Swim", "Velomobile", "VirtualRide", "VirtualRun", "Walk", "WeightTraining", "Wheelchair", "Windsurf", "Workout", "Yoga" ], "type": "string" }, "SummaryClub": { "title": "SummaryClub", "type": "object", "properties": { "id": { "title": "Id", "type": "integer" }, "name": { "title": "Name", "type": "string" }, "resource_state": { "title": "Resource State", "type": "integer" }, "activity_types": { "title": "Activity Types", "type": "array", "items": { "$ref": "#/definitions/ActivityType" } }, "city": { "title": "City", "type": "string" }, "country": { "title": "Country", "type": "string" }, "cover_photo": { "title": "Cover Photo", "type": "string" }, "cover_photo_small": { "title": "Cover Photo Small", "type": "string" }, "featured": { "title": "Featured", "type": "boolean" }, "member_count": { "title": "Member Count", "type": "integer" }, "private": { "title": "Private", "type": "boolean" }, "profile_medium": { "title": "Profile Medium", "type": "string" }, "sport_type": { "title": "Sport Type", "enum": [ "cycling", "running", "triathlon", "other" ], "type": "string" }, "state": { "title": "State", "type": "string" }, "url": { "title": "Url", "type": "string" }, "verified": { "title": "Verified", "type": "boolean" } } } } }
- Fields:
- Validators:
- field admin: bool | None = None#
- field agreed_to_terms: str | None = None#
- field approve_followers: bool | None = None#
- field athlete_type: Literal['cyclist', 'runner'] | None = None#
- Validated by:
- field badge_type_id: int | None = None#
- field bikes: list[SummaryGear] | None = None#
The athleteโs bikes.
- field bound_client: Any | None = None#
- field city: str | None = None#
The athleteโs city.
- field clubs: list[SummaryClub] | None = None#
The athleteโs clubs.
- field country: str | None = None#
The athleteโs country.
- field created_at: datetime | None = None#
The time at which the athlete was created.
- field date_preference: str | None = None#
- field dateofbirth: date | None = None#
- field description: str | None = None#
- field email: str | None = None#
- field email_facebook_twitter_friend_joins: bool | None = None#
- field email_kom_lost: bool | None = None#
- field email_language: str | None = None#
- field email_send_follower_notices: bool | None = None#
- field facebook_sharing_enabled: bool | None = None#
- field firstname: str | None = None#
The athleteโs first name.
- field follower: str | None = None#
- field follower_count: int | None = None#
The athleteโs follower count.
- field follower_request_count: int | None = None#
- field friend: str | None = None#
- field friend_count: int | None = None#
The athleteโs friend count.
- field ftp: int | None = None#
The athleteโs FTP (Functional Threshold Power).
- field global_privacy: bool | None = None#
- field id: int | None = None#
The unique identifier of the athlete
- field instagram_username: str | None = None#
- field is_authenticated: bool | None = None#
- field lastname: str | None = None#
The athleteโs last name.
- field max_heartrate: float | None = None#
- field measurement_preference: Literal['feet', 'meters'] | None = None#
The athleteโs preferred unit system.
- field membership: str | None = None#
- field mutual_friend_count: int | None = None#
- field offer_in_app_payment: bool | None = None#
- field owner: bool | None = None#
- field plan: str | None = None#
Deprecated. Use summit field instead. Whether the athlete has any Summit subscription.
- field profile: str | None = None#
URL to a 124x124 pixel profile picture.
- field profile_medium: str | None = None#
URL to a 62x62 pixel profile picture.
- field profile_original: str | None = None#
- field receive_comment_emails: bool | None = None#
- field receive_follower_feed_emails: bool | None = None#
- field receive_kudos_emails: bool | None = None#
- field receive_newsletter: bool | None = None#
- field resource_state: int | None = None#
Resource state, indicates level of detail. Possible values: 1 -> โmetaโ, 2 -> โsummaryโ, 3 -> โdetailโ
- field sample_race_distance: int | None = None#
- field sample_race_time: int | None = None#
- field sex: Literal['M', 'F'] | None = None#
The athleteโs sex.
- field shoes: list[SummaryGear] | None = None#
The athleteโs shoes.
- field state: str | None = None#
The athleteโs state or geographical region.
- field subscription_permissions: list[bool] | None = None#
- field summit: bool | None = None#
Whether the athlete has any Summit subscription.
- field super_user: bool | None = None#
- field updated_at: datetime | None = None#
The time at which the athlete was last updated.
- field username: str | None = None#
- field weight: float | None = None#
The athleteโs weight.
- classmethod deserialize(attribute_value_mapping: dict[str, Any]) Self #
Creates and returns a new object based on serialized (dict) struct.
- Parameters:
attribute_value_mapping (dict) โ A dictionary representing the serialized data.
- Returns:
DeprecatedSerializableMixin โ A new instance of the class created from the serialized data.
Deprecated
โโโ-
1.0.0 โ The deserialize() method is deprecated in favor of parse_obj() method. For more details, refer to the Pydantic documentation: https://docs.pydantic.dev/usage/models/#helper-functions
- from_dict(attribute_value_mapping: dict[str, Any]) None #
Deserializes a dict into self, resetting and/or overwriting existing fields.
- Parameters:
attribute_value_mapping (dict) โ A dictionary that will be deserialized into the parent object.
Deprecated
----------
1.0.0 โ The from_dict() method is deprecated in favor of parse_obj() method. For more details, refer to the Pydantic documentation: https://docs.pydantic.dev/usage/models/#helper-functions
- is_authenticated_athlete() bool #
Check if the athlete is authenticated
- Returns:
Whether the athlete is the authenticated athlete (or not).
- Return type:
bool
- to_dict() dict[str, Any] #
Returns a dict representation of self
- Returns:
dict โ A dictionary containing the data from the instance.
Deprecated
โโโ- โ The to_dict() method is deprecated in favor of dict() method. For more details, refer to the Pydantic documentation: https://docs.pydantic.dev/1.10/usage/exporting_models/
- validator to_str_representation ยป athlete_type#
Replaces legacy โChoicesAttributeโ class.
- Parameters:
raw_type (int) โ The raw integer representing the athlete type.
- Returns:
The string representation of the athlete type.
- Return type:
str
- property authenticated_athlete: Athlete#
Returns an Athlete object containing Strava account data for the (authenticated) athlete.
- Returns:
The detailed information of the authenticated athlete.
- Return type:
- property stats: AthleteStats#
Grabs statistics for an (authenticated) athlete.
- Return type:
Associated
stravalib.model.AthleteStats
- Raises:
missing. โ
- pydantic model stravalib.model.ActivityLap[source]#
Show JSON schema
{ "title": "ActivityLap", "description": "Mixin that intercepts attribute lookup and raises warnings or modifies\nreturn values based on what is defined in the following class attributes:\n\n* _field_conversions\n\nNotes\n------\nThe class attributes below are not yet implemented:\n* _deprecated_fields (TODO)\n* _unsupported_fields (TODO)", "type": "object", "properties": { "bound_client": { "title": "Bound Client" }, "activity": { "$ref": "#/definitions/Activity" }, "athlete": { "$ref": "#/definitions/Athlete" }, "average_cadence": { "title": "Average Cadence", "type": "number" }, "average_speed": { "title": "Average Speed", "type": "number" }, "distance": { "title": "Distance", "type": "number" }, "elapsed_time": { "title": "Elapsed Time", "type": "number", "format": "time-delta" }, "end_index": { "title": "End Index", "type": "integer" }, "id": { "title": "Id", "type": "integer" }, "lap_index": { "title": "Lap Index", "type": "integer" }, "max_speed": { "title": "Max Speed", "type": "number" }, "moving_time": { "title": "Moving Time", "type": "number", "format": "time-delta" }, "name": { "title": "Name", "type": "string" }, "pace_zone": { "title": "Pace Zone", "type": "integer" }, "split": { "title": "Split", "type": "integer" }, "start_date": { "title": "Start Date", "type": "string", "format": "date-time" }, "start_date_local": { "title": "Start Date Local", "type": "string", "format": "date-time" }, "start_index": { "title": "Start Index", "type": "integer" }, "total_elevation_gain": { "title": "Total Elevation Gain", "type": "number" }, "average_watts": { "title": "Average Watts", "type": "number" }, "average_heartrate": { "title": "Average Heartrate", "type": "number" }, "max_heartrate": { "title": "Max Heartrate", "type": "number" }, "device_watts": { "title": "Device Watts", "type": "boolean" } }, "definitions": { "SummaryGear": { "title": "SummaryGear", "type": "object", "properties": { "distance": { "title": "Distance", "type": "number" }, "id": { "title": "Id", "type": "string" }, "name": { "title": "Name", "type": "string" }, "primary": { "title": "Primary", "type": "boolean" }, "resource_state": { "title": "Resource State", "type": "integer" } } }, "ActivityType": { "title": "ActivityType", "enum": [ "AlpineSki", "BackcountrySki", "Canoeing", "Crossfit", "EBikeRide", "Elliptical", "Golf", "Handcycle", "Hike", "IceSkate", "InlineSkate", "Kayaking", "Kitesurf", "NordicSki", "Ride", "RockClimbing", "RollerSki", "Rowing", "Run", "Sail", "Skateboard", "Snowboard", "Snowshoe", "Soccer", "StairStepper", "StandUpPaddling", "Surfing", "Swim", "Velomobile", "VirtualRide", "VirtualRun", "Walk", "WeightTraining", "Wheelchair", "Windsurf", "Workout", "Yoga" ], "type": "string" }, "SummaryClub": { "title": "SummaryClub", "type": "object", "properties": { "id": { "title": "Id", "type": "integer" }, "name": { "title": "Name", "type": "string" }, "resource_state": { "title": "Resource State", "type": "integer" }, "activity_types": { "title": "Activity Types", "type": "array", "items": { "$ref": "#/definitions/ActivityType" } }, "city": { "title": "City", "type": "string" }, "country": { "title": "Country", "type": "string" }, "cover_photo": { "title": "Cover Photo", "type": "string" }, "cover_photo_small": { "title": "Cover Photo Small", "type": "string" }, "featured": { "title": "Featured", "type": "boolean" }, "member_count": { "title": "Member Count", "type": "integer" }, "private": { "title": "Private", "type": "boolean" }, "profile_medium": { "title": "Profile Medium", "type": "string" }, "sport_type": { "title": "Sport Type", "enum": [ "cycling", "running", "triathlon", "other" ], "type": "string" }, "state": { "title": "State", "type": "string" }, "url": { "title": "Url", "type": "string" }, "verified": { "title": "Verified", "type": "boolean" } } }, "Athlete": { "title": "Athlete", "description": "Represents high level athlete information including\ntheir name, email, clubs they belong to, bikes, shoes, etc.\n\nNotes\n------\nAlso provides access to detailed athlete stats upon request.\nMany attributes in this object are undocumented by Strava and could be\nmodified at any time.", "type": "object", "properties": { "bound_client": { "title": "Bound Client" }, "id": { "title": "Id", "type": "integer" }, "city": { "title": "City", "type": "string" }, "country": { "title": "Country", "type": "string" }, "created_at": { "title": "Created At", "type": "string", "format": "date-time" }, "firstname": { "title": "Firstname", "type": "string" }, "lastname": { "title": "Lastname", "type": "string" }, "premium": { "title": "Premium", "type": "boolean" }, "profile": { "title": "Profile", "type": "string" }, "profile_medium": { "title": "Profile Medium", "type": "string" }, "resource_state": { "title": "Resource State", "type": "integer" }, "sex": { "title": "Sex", "enum": [ "M", "F" ], "type": "string" }, "state": { "title": "State", "type": "string" }, "summit": { "title": "Summit", "type": "boolean" }, "updated_at": { "title": "Updated At", "type": "string", "format": "date-time" }, "bikes": { "title": "Bikes", "type": "array", "items": { "$ref": "#/definitions/SummaryGear" } }, "clubs": { "title": "Clubs", "type": "array", "items": { "$ref": "#/definitions/SummaryClub" } }, "follower_count": { "title": "Follower Count", "type": "integer" }, "friend_count": { "title": "Friend Count", "type": "integer" }, "ftp": { "title": "Ftp", "type": "integer" }, "measurement_preference": { "title": "Measurement Preference", "enum": [ "feet", "meters" ], "type": "string" }, "shoes": { "title": "Shoes", "type": "array", "items": { "$ref": "#/definitions/SummaryGear" } }, "weight": { "title": "Weight", "type": "number" }, "is_authenticated": { "title": "Is Authenticated", "type": "boolean" }, "athlete_type": { "title": "Athlete Type", "enum": [ "cyclist", "runner" ], "type": "string" }, "friend": { "title": "Friend", "type": "string" }, "follower": { "title": "Follower", "type": "string" }, "approve_followers": { "title": "Approve Followers", "type": "boolean" }, "badge_type_id": { "title": "Badge Type Id", "type": "integer" }, "mutual_friend_count": { "title": "Mutual Friend Count", "type": "integer" }, "date_preference": { "title": "Date Preference", "type": "string" }, "email": { "title": "Email", "type": "string" }, "super_user": { "title": "Super User", "type": "boolean" }, "email_language": { "title": "Email Language", "type": "string" }, "max_heartrate": { "title": "Max Heartrate", "type": "number" }, "username": { "title": "Username", "type": "string" }, "description": { "title": "Description", "type": "string" }, "instagram_username": { "title": "Instagram Username", "type": "string" }, "offer_in_app_payment": { "title": "Offer In App Payment", "type": "boolean" }, "global_privacy": { "title": "Global Privacy", "type": "boolean" }, "receive_newsletter": { "title": "Receive Newsletter", "type": "boolean" }, "email_kom_lost": { "title": "Email Kom Lost", "type": "boolean" }, "dateofbirth": { "title": "Dateofbirth", "type": "string", "format": "date" }, "facebook_sharing_enabled": { "title": "Facebook Sharing Enabled", "type": "boolean" }, "profile_original": { "title": "Profile Original", "type": "string" }, "premium_expiration_date": { "title": "Premium Expiration Date", "type": "integer" }, "email_send_follower_notices": { "title": "Email Send Follower Notices", "type": "boolean" }, "plan": { "title": "Plan", "type": "string" }, "agreed_to_terms": { "title": "Agreed To Terms", "type": "string" }, "follower_request_count": { "title": "Follower Request Count", "type": "integer" }, "email_facebook_twitter_friend_joins": { "title": "Email Facebook Twitter Friend Joins", "type": "boolean" }, "receive_kudos_emails": { "title": "Receive Kudos Emails", "type": "boolean" }, "receive_follower_feed_emails": { "title": "Receive Follower Feed Emails", "type": "boolean" }, "receive_comment_emails": { "title": "Receive Comment Emails", "type": "boolean" }, "sample_race_distance": { "title": "Sample Race Distance", "type": "integer" }, "sample_race_time": { "title": "Sample Race Time", "type": "integer" }, "membership": { "title": "Membership", "type": "string" }, "admin": { "title": "Admin", "type": "boolean" }, "owner": { "title": "Owner", "type": "boolean" }, "subscription_permissions": { "title": "Subscription Permissions", "type": "array", "items": { "type": "boolean" } } } }, "LatLon": { "title": "LatLon", "description": "Enables backward compatibility for legacy namedtuple", "minItems": 2, "maxItems": 2, "type": "array", "items": { "type": "number" } }, "Map": { "title": "Map", "description": "Pass through object. Inherits from PolyLineMap", "type": "object", "properties": { "id": { "title": "Id", "type": "string" }, "polyline": { "title": "Polyline", "type": "string" }, "summary_polyline": { "title": "Summary Polyline", "type": "string" } } }, "RelaxedSportType": { "title": "RelaxedSportType", "enum": [ "AlpineSki", "BackcountrySki", "Badminton", "Canoeing", "Crossfit", "EBikeRide", "Elliptical", "EMountainBikeRide", "Golf", "GravelRide", "Handcycle", "HighIntensityIntervalTraining", "Hike", "IceSkate", "InlineSkate", "Kayaking", "Kitesurf", "MountainBikeRide", "NordicSki", "Pickleball", "Pilates", "Racquetball", "Ride", "RockClimbing", "RollerSki", "Rowing", "Run", "Sail", "Skateboard", "Snowboard", "Snowshoe", "Soccer", "Squash", "StairStepper", "StandUpPaddling", "Surfing", "Swim", "TableTennis", "Tennis", "TrailRun", "Velomobile", "VirtualRide", "VirtualRow", "VirtualRun", "Walk", "WeightTraining", "Wheelchair", "Windsurf", "Workout", "Yoga" ], "type": "string" }, "RelaxedActivityType": { "title": "RelaxedActivityType", "enum": [ "AlpineSki", "BackcountrySki", "Canoeing", "Crossfit", "EBikeRide", "Elliptical", "Golf", "Handcycle", "Hike", "IceSkate", "InlineSkate", "Kayaking", "Kitesurf", "NordicSki", "Ride", "RockClimbing", "RollerSki", "Rowing", "Run", "Sail", "Skateboard", "Snowboard", "Snowshoe", "Soccer", "StairStepper", "StandUpPaddling", "Surfing", "Swim", "Velomobile", "VirtualRide", "VirtualRun", "Walk", "WeightTraining", "Wheelchair", "Windsurf", "Workout", "Yoga" ], "type": "string" }, "AthletePrEffort": { "title": "AthletePrEffort", "description": "Mixin that intercepts attribute lookup and raises warnings or modifies\nreturn values based on what is defined in the following class attributes:\n\n* _field_conversions\n\nNotes\n------\nThe class attributes below are not yet implemented:\n* _deprecated_fields (TODO)\n* _unsupported_fields (TODO)", "type": "object", "properties": { "effort_count": { "title": "Effort Count", "type": "integer" }, "pr_activity_id": { "title": "Pr Activity Id", "type": "integer" }, "pr_date": { "title": "Pr Date", "type": "string", "format": "date-time" }, "pr_elapsed_time": { "title": "Pr Elapsed Time", "type": "number", "format": "time-delta" }, "distance": { "title": "Distance", "type": "number" }, "start_date": { "title": "Start Date", "type": "string", "format": "date-time" }, "start_date_local": { "title": "Start Date Local", "type": "string", "format": "date-time" }, "is_kom": { "title": "Is Kom", "type": "boolean" } } }, "AthleteSegmentStats": { "title": "AthleteSegmentStats", "description": "A structure being returned for segment stats for current athlete.", "type": "object", "properties": { "activity_id": { "title": "Activity Id", "type": "integer" }, "distance": { "title": "Distance", "type": "number" }, "elapsed_time": { "title": "Elapsed Time", "type": "number", "format": "time-delta" }, "id": { "title": "Id", "type": "integer" }, "is_kom": { "title": "Is Kom", "type": "boolean" }, "start_date": { "title": "Start Date", "type": "string", "format": "date-time" }, "start_date_local": { "title": "Start Date Local", "type": "string", "format": "date-time" }, "effort_count": { "title": "Effort Count", "type": "integer" }, "pr_elapsed_time": { "title": "Pr Elapsed Time", "type": "number", "format": "time-delta" }, "pr_date": { "title": "Pr Date", "type": "string", "format": "date" } } }, "Segment": { "title": "Segment", "description": "Represents a single Strava segment.", "type": "object", "properties": { "bound_client": { "title": "Bound Client" }, "activity_type": { "$ref": "#/definitions/RelaxedActivityType" }, "athlete_pr_effort": { "$ref": "#/definitions/AthletePrEffort" }, "athlete_segment_stats": { "$ref": "#/definitions/AthleteSegmentStats" }, "average_grade": { "title": "Average Grade", "type": "number" }, "city": { "title": "City", "type": "string" }, "climb_category": { "title": "Climb Category", "type": "integer" }, "country": { "title": "Country", "type": "string" }, "distance": { "title": "Distance", "type": "number" }, "elevation_high": { "title": "Elevation High", "type": "number" }, "elevation_low": { "title": "Elevation Low", "type": "number" }, "end_latlng": { "$ref": "#/definitions/LatLon" }, "id": { "title": "Id", "type": "integer" }, "maximum_grade": { "title": "Maximum Grade", "type": "number" }, "name": { "title": "Name", "type": "string" }, "private": { "title": "Private", "type": "boolean" }, "start_latlng": { "$ref": "#/definitions/LatLon" }, "state": { "title": "State", "type": "string" }, "athlete_count": { "title": "Athlete Count", "type": "integer" }, "created_at": { "title": "Created At", "type": "string", "format": "date-time" }, "effort_count": { "title": "Effort Count", "type": "integer" }, "hazardous": { "title": "Hazardous", "type": "boolean" }, "map": { "$ref": "#/definitions/Map" }, "star_count": { "title": "Star Count", "type": "integer" }, "total_elevation_gain": { "title": "Total Elevation Gain", "type": "number" }, "updated_at": { "title": "Updated At", "type": "string", "format": "date-time" }, "start_latitude": { "title": "Start Latitude", "type": "number" }, "end_latitude": { "title": "End Latitude", "type": "number" }, "start_longitude": { "title": "Start Longitude", "type": "number" }, "end_longitude": { "title": "End Longitude", "type": "number" }, "starred": { "title": "Starred", "type": "boolean" }, "pr_time": { "title": "Pr Time", "type": "number", "format": "time-delta" }, "starred_date": { "title": "Starred Date", "type": "string", "format": "date-time" }, "elevation_profile": { "title": "Elevation Profile", "type": "string" } } }, "BestEffort": { "title": "BestEffort", "description": "Class representing a best effort (e.g. best time for 5k)", "type": "object", "properties": { "bound_client": { "title": "Bound Client" }, "activity_id": { "title": "Activity Id", "type": "integer" }, "distance": { "title": "Distance", "type": "number" }, "elapsed_time": { "title": "Elapsed Time", "type": "number", "format": "time-delta" }, "id": { "title": "Id", "type": "integer" }, "is_kom": { "title": "Is Kom", "type": "boolean" }, "start_date": { "title": "Start Date", "type": "string", "format": "date-time" }, "start_date_local": { "title": "Start Date Local", "type": "string", "format": "date-time" }, "activity": { "$ref": "#/definitions/Activity" }, "athlete": { "$ref": "#/definitions/Athlete" }, "average_cadence": { "title": "Average Cadence", "type": "number" }, "average_heartrate": { "title": "Average Heartrate", "type": "number" }, "average_watts": { "title": "Average Watts", "type": "number" }, "device_watts": { "title": "Device Watts", "type": "boolean" }, "end_index": { "title": "End Index", "type": "integer" }, "hidden": { "title": "Hidden", "type": "boolean" }, "kom_rank": { "title": "Kom Rank", "minimum": 1, "maximum": 10, "type": "integer" }, "max_heartrate": { "title": "Max Heartrate", "type": "number" }, "moving_time": { "title": "Moving Time", "type": "number", "format": "time-delta" }, "name": { "title": "Name", "type": "string" }, "pr_rank": { "title": "Pr Rank", "minimum": 1, "maximum": 3, "type": "integer" }, "segment": { "$ref": "#/definitions/Segment" }, "start_index": { "title": "Start Index", "type": "integer" } } }, "Gear": { "title": "Gear", "description": "Represents a piece of gear (equipment) used in physical activities.", "type": "object", "properties": { "distance": { "title": "Distance", "type": "number" }, "id": { "title": "Id", "type": "string" }, "name": { "title": "Name", "type": "string" }, "primary": { "title": "Primary", "type": "boolean" }, "resource_state": { "title": "Resource State", "type": "integer" }, "brand_name": { "title": "Brand Name", "type": "string" }, "description": { "title": "Description", "type": "string" }, "frame_type": { "title": "Frame Type", "type": "integer" }, "model_name": { "title": "Model Name", "type": "string" } } }, "MetaActivity": { "title": "MetaActivity", "type": "object", "properties": { "id": { "title": "Id", "type": "integer" } } }, "MetaAthlete": { "title": "MetaAthlete", "type": "object", "properties": { "id": { "title": "Id", "type": "integer" } } }, "Lap": { "title": "Lap", "type": "object", "properties": { "activity": { "$ref": "#/definitions/MetaActivity" }, "athlete": { "$ref": "#/definitions/MetaAthlete" }, "average_cadence": { "title": "Average Cadence", "type": "number" }, "average_speed": { "title": "Average Speed", "type": "number" }, "distance": { "title": "Distance", "type": "number" }, "elapsed_time": { "title": "Elapsed Time", "type": "integer" }, "end_index": { "title": "End Index", "type": "integer" }, "id": { "title": "Id", "type": "integer" }, "lap_index": { "title": "Lap Index", "type": "integer" }, "max_speed": { "title": "Max Speed", "type": "number" }, "moving_time": { "title": "Moving Time", "type": "integer" }, "name": { "title": "Name", "type": "string" }, "pace_zone": { "title": "Pace Zone", "type": "integer" }, "split": { "title": "Split", "type": "integer" }, "start_date": { "title": "Start Date", "type": "string", "format": "date-time" }, "start_date_local": { "title": "Start Date Local", "type": "string", "format": "date-time" }, "start_index": { "title": "Start Index", "type": "integer" }, "total_elevation_gain": { "title": "Total Elevation Gain", "type": "number" } } }, "ActivityPhotoPrimary": { "title": "ActivityPhotoPrimary", "description": "Represents the primary photo for an activity.\n\nAttributes\n----------\nuse_primary_photo : bool, optional\n Indicates whether the photo is used as the primary photo.\n\nNotes\n-----\nAttributes for activity photos are currently undocumented.", "type": "object", "properties": { "id": { "title": "Id", "type": "integer" }, "source": { "title": "Source", "type": "integer" }, "unique_id": { "title": "Unique Id", "type": "string" }, "urls": { "title": "Urls", "type": "object", "additionalProperties": { "type": "string" } }, "use_primary_photo": { "title": "Use Primary Photo", "type": "boolean" } } }, "ActivityPhotoMeta": { "title": "ActivityPhotoMeta", "description": "Represents the metadata of photos returned with the activity.\n\nNot to be confused with the fully loaded photos for an activity.\n\nAttributes\n----------\nprimary : ActivityPhotoPrimary, optional\n The primary photo for the activity.\nuse_primary_photo : bool, optional\n Indicates whether the primary photo is used. Not currently documented\n by Strava.\n\nNotes\n-----\nUndocumented attributes could be changed by Strava at any time.", "type": "object", "properties": { "count": { "title": "Count", "type": "integer" }, "primary": { "$ref": "#/definitions/ActivityPhotoPrimary" }, "use_primary_photo": { "title": "Use Primary Photo", "type": "boolean" } } }, "SegmentEffortAchievement": { "title": "SegmentEffortAchievement", "description": "An undocumented structure being returned for segment efforts.\n\nNotes\n-----\nUndocumented Strava elements can change at any time without notice.", "type": "object", "properties": { "rank": { "title": "Rank", "type": "integer" }, "type": { "title": "Type", "type": "string" }, "type_id": { "title": "Type Id", "type": "integer" }, "effort_count": { "title": "Effort Count", "type": "integer" } } }, "SegmentEffort": { "title": "SegmentEffort", "description": "Class representing a best effort on a particular segment.", "type": "object", "properties": { "bound_client": { "title": "Bound Client" }, "activity_id": { "title": "Activity Id", "type": "integer" }, "distance": { "title": "Distance", "type": "number" }, "elapsed_time": { "title": "Elapsed Time", "type": "number", "format": "time-delta" }, "id": { "title": "Id", "type": "integer" }, "is_kom": { "title": "Is Kom", "type": "boolean" }, "start_date": { "title": "Start Date", "type": "string", "format": "date-time" }, "start_date_local": { "title": "Start Date Local", "type": "string", "format": "date-time" }, "activity": { "$ref": "#/definitions/Activity" }, "athlete": { "$ref": "#/definitions/Athlete" }, "average_cadence": { "title": "Average Cadence", "type": "number" }, "average_heartrate": { "title": "Average Heartrate", "type": "number" }, "average_watts": { "title": "Average Watts", "type": "number" }, "device_watts": { "title": "Device Watts", "type": "boolean" }, "end_index": { "title": "End Index", "type": "integer" }, "hidden": { "title": "Hidden", "type": "boolean" }, "kom_rank": { "title": "Kom Rank", "minimum": 1, "maximum": 10, "type": "integer" }, "max_heartrate": { "title": "Max Heartrate", "type": "number" }, "moving_time": { "title": "Moving Time", "type": "number", "format": "time-delta" }, "name": { "title": "Name", "type": "string" }, "pr_rank": { "title": "Pr Rank", "minimum": 1, "maximum": 3, "type": "integer" }, "segment": { "$ref": "#/definitions/Segment" }, "start_index": { "title": "Start Index", "type": "integer" }, "achievements": { "title": "Achievements", "type": "array", "items": { "$ref": "#/definitions/SegmentEffortAchievement" } } } }, "Split": { "title": "Split", "description": "A split -- may be metric or standard units (which has no bearing\non the units used in this object, just the binning of values).", "type": "object", "properties": { "average_speed": { "title": "Average Speed", "type": "number" }, "distance": { "title": "Distance", "type": "number" }, "elapsed_time": { "title": "Elapsed Time", "type": "number", "format": "time-delta" }, "elevation_difference": { "title": "Elevation Difference", "type": "number" }, "moving_time": { "title": "Moving Time", "type": "number", "format": "time-delta" }, "pace_zone": { "title": "Pace Zone", "type": "integer" }, "split": { "title": "Split", "type": "integer" }, "average_heartrate": { "title": "Average Heartrate", "type": "number" }, "average_grade_adjusted_speed": { "title": "Average Grade Adjusted Speed", "type": "number" } } }, "Activity": { "title": "Activity", "description": "Represents an activity (ride, run, etc.).", "type": "object", "properties": { "bound_client": { "title": "Bound Client" }, "id": { "title": "Id", "type": "integer" }, "achievement_count": { "title": "Achievement Count", "type": "integer" }, "athlete": { "$ref": "#/definitions/Athlete" }, "athlete_count": { "title": "Athlete Count", "minimum": 1, "type": "integer" }, "average_speed": { "title": "Average Speed", "type": "number" }, "average_watts": { "title": "Average Watts", "type": "number" }, "comment_count": { "title": "Comment Count", "type": "integer" }, "commute": { "title": "Commute", "type": "boolean" }, "device_watts": { "title": "Device Watts", "type": "boolean" }, "distance": { "title": "Distance", "type": "number" }, "elapsed_time": { "title": "Elapsed Time", "type": "number", "format": "time-delta" }, "elev_high": { "title": "Elev High", "type": "number" }, "elev_low": { "title": "Elev Low", "type": "number" }, "end_latlng": { "$ref": "#/definitions/LatLon" }, "external_id": { "title": "External Id", "type": "string" }, "flagged": { "title": "Flagged", "type": "boolean" }, "gear_id": { "title": "Gear Id", "type": "string" }, "has_kudoed": { "title": "Has Kudoed", "type": "boolean" }, "hide_from_home": { "title": "Hide From Home", "type": "boolean" }, "kilojoules": { "title": "Kilojoules", "type": "number" }, "kudos_count": { "title": "Kudos Count", "type": "integer" }, "manual": { "title": "Manual", "type": "boolean" }, "map": { "$ref": "#/definitions/Map" }, "max_speed": { "title": "Max Speed", "type": "number" }, "max_watts": { "title": "Max Watts", "type": "integer" }, "moving_time": { "title": "Moving Time", "type": "number", "format": "time-delta" }, "name": { "title": "Name", "type": "string" }, "photo_count": { "title": "Photo Count", "type": "integer" }, "private": { "title": "Private", "type": "boolean" }, "sport_type": { "$ref": "#/definitions/RelaxedSportType" }, "start_date": { "title": "Start Date", "type": "string", "format": "date-time" }, "start_date_local": { "title": "Start Date Local", "type": "string", "format": "date-time" }, "start_latlng": { "$ref": "#/definitions/LatLon" }, "timezone": { "title": "Timezone", "type": "string" }, "total_elevation_gain": { "title": "Total Elevation Gain", "type": "number" }, "total_photo_count": { "title": "Total Photo Count", "type": "integer" }, "trainer": { "title": "Trainer", "type": "boolean" }, "type": { "$ref": "#/definitions/RelaxedActivityType" }, "upload_id": { "title": "Upload Id", "type": "integer" }, "upload_id_str": { "title": "Upload Id Str", "type": "string" }, "weighted_average_watts": { "title": "Weighted Average Watts", "type": "integer" }, "workout_type": { "title": "Workout Type", "type": "integer" }, "best_efforts": { "title": "Best Efforts", "type": "array", "items": { "$ref": "#/definitions/BestEffort" } }, "calories": { "title": "Calories", "type": "number" }, "description": { "title": "Description", "type": "string" }, "device_name": { "title": "Device Name", "type": "string" }, "embed_token": { "title": "Embed Token", "type": "string" }, "gear": { "$ref": "#/definitions/Gear" }, "laps": { "title": "Laps", "type": "array", "items": { "$ref": "#/definitions/Lap" } }, "photos": { "$ref": "#/definitions/ActivityPhotoMeta" }, "segment_efforts": { "title": "Segment Efforts", "type": "array", "items": { "$ref": "#/definitions/SegmentEffort" } }, "splits_metric": { "title": "Splits Metric", "type": "array", "items": { "$ref": "#/definitions/Split" } }, "splits_standard": { "title": "Splits Standard", "type": "array", "items": { "$ref": "#/definitions/Split" } }, "guid": { "title": "Guid", "type": "string" }, "utc_offset": { "title": "Utc Offset", "type": "number" }, "location_city": { "title": "Location City", "type": "string" }, "location_state": { "title": "Location State", "type": "string" }, "location_country": { "title": "Location Country", "type": "string" }, "start_latitude": { "title": "Start Latitude", "type": "number" }, "start_longitude": { "title": "Start Longitude", "type": "number" }, "pr_count": { "title": "Pr Count", "type": "integer" }, "suffer_score": { "title": "Suffer Score", "type": "integer" }, "has_heartrate": { "title": "Has Heartrate", "type": "boolean" }, "average_heartrate": { "title": "Average Heartrate", "type": "number" }, "max_heartrate": { "title": "Max Heartrate", "type": "integer" }, "average_cadence": { "title": "Average Cadence", "type": "number" }, "average_temp": { "title": "Average Temp", "type": "integer" }, "instagram_primary_photo": { "title": "Instagram Primary Photo", "type": "string" }, "partner_logo_url": { "title": "Partner Logo Url", "type": "string" }, "partner_brand_tag": { "title": "Partner Brand Tag", "type": "string" }, "from_accepted_tag": { "title": "From Accepted Tag", "type": "boolean" }, "segment_leaderboard_opt_out": { "title": "Segment Leaderboard Opt Out", "type": "boolean" }, "perceived_exertion": { "title": "Perceived Exertion", "type": "integer" } } } } }
- Fields:
- Validators:
- field average_cadence: float | None = None#
The lapโs average cadence
- field average_heartrate: float | None = None#
- field average_speed: float | None = None#
The lapโs average speed
- field average_watts: float | None = None#
- field bound_client: Any | None = None#
- field device_watts: bool | None = None#
- field distance: float | None = None#
The lapโs distance, in meters
- field elapsed_time: timedelta | None = None#
The lapโs elapsed time, in seconds
- field end_index: int | None = None#
The end index of this effort in its activityโs stream
- field id: int | None = None#
The unique identifier of this lap
- field lap_index: int | None = None#
The index of this lap in the activity it belongs to
- field max_heartrate: float | None = None#
- field max_speed: float | None = None#
The maximum speed of this lat, in meters per second
- field moving_time: timedelta | None = None#
The lapโs moving time, in seconds
- field name: str | None = None#
The name of the lap
- field pace_zone: int | None = None#
The athleteโs pace zone during this lap
- field split: int | None = None#
- field start_date: datetime | None = None#
The time at which the lap was started.
- field start_date_local: datetime | None = None#
The time at which the lap was started in the local timezone.
- Validated by:
- field start_index: int | None = None#
The start index of this effort in its activityโs stream
- field total_elevation_gain: float | None = None#
The elevation gain of this lap, in meters
- classmethod deserialize(attribute_value_mapping: dict[str, Any]) Self #
Creates and returns a new object based on serialized (dict) struct.
- Parameters:
attribute_value_mapping (dict) โ A dictionary representing the serialized data.
- Returns:
DeprecatedSerializableMixin โ A new instance of the class created from the serialized data.
Deprecated
โโโ-
1.0.0 โ The deserialize() method is deprecated in favor of parse_obj() method. For more details, refer to the Pydantic documentation: https://docs.pydantic.dev/usage/models/#helper-functions
- from_dict(attribute_value_mapping: dict[str, Any]) None #
Deserializes a dict into self, resetting and/or overwriting existing fields.
- Parameters:
attribute_value_mapping (dict) โ A dictionary that will be deserialized into the parent object.
Deprecated
----------
1.0.0 โ The from_dict() method is deprecated in favor of parse_obj() method. For more details, refer to the Pydantic documentation: https://docs.pydantic.dev/usage/models/#helper-functions
- to_dict() dict[str, Any] #
Returns a dict representation of self
- Returns:
dict โ A dictionary containing the data from the instance.
Deprecated
โโโ- โ The to_dict() method is deprecated in favor of dict() method. For more details, refer to the Pydantic documentation: https://docs.pydantic.dev/1.10/usage/exporting_models/
- pydantic model stravalib.model.Map[source]#
Pass through object. Inherits from PolyLineMap
Show JSON schema
{ "title": "Map", "description": "Pass through object. Inherits from PolyLineMap", "type": "object", "properties": { "id": { "title": "Id", "type": "string" }, "polyline": { "title": "Polyline", "type": "string" }, "summary_polyline": { "title": "Summary Polyline", "type": "string" } } }
- field id: str | None = None#
The identifier of the map
- field polyline: str | None = None#
The polyline of the map, only returned on detailed representation of an object
- field summary_polyline: str | None = None#
The summary polyline of the map
- pydantic model stravalib.model.Split[source]#
A split โ may be metric or standard units (which has no bearing on the units used in this object, just the binning of values).
Show JSON schema
{ "title": "Split", "description": "A split -- may be metric or standard units (which has no bearing\non the units used in this object, just the binning of values).", "type": "object", "properties": { "average_speed": { "title": "Average Speed", "type": "number" }, "distance": { "title": "Distance", "type": "number" }, "elapsed_time": { "title": "Elapsed Time", "type": "number", "format": "time-delta" }, "elevation_difference": { "title": "Elevation Difference", "type": "number" }, "moving_time": { "title": "Moving Time", "type": "number", "format": "time-delta" }, "pace_zone": { "title": "Pace Zone", "type": "integer" }, "split": { "title": "Split", "type": "integer" }, "average_heartrate": { "title": "Average Heartrate", "type": "number" }, "average_grade_adjusted_speed": { "title": "Average Grade Adjusted Speed", "type": "number" } } }
- Fields:
- field average_grade_adjusted_speed: float | None = None#
- field average_heartrate: float | None = None#
- field average_speed: float | None = None#
The average speed of this split, in meters per second
- field distance: float | None = None#
The distance of this split, in meters
- field elapsed_time: timedelta | None = None#
The elapsed time of this split, in seconds
- field elevation_difference: float | None = None#
The elevation difference of this split, in meters
- field moving_time: timedelta | None = None#
The moving time of this split, in seconds
- field pace_zone: int | None = None#
The pacing zone of this split
- field split: int | None = None#
N/A
- classmethod deserialize(attribute_value_mapping: dict[str, Any]) Self #
Creates and returns a new object based on serialized (dict) struct.
- Parameters:
attribute_value_mapping (dict) โ A dictionary representing the serialized data.
- Returns:
DeprecatedSerializableMixin โ A new instance of the class created from the serialized data.
Deprecated
โโโ-
1.0.0 โ The deserialize() method is deprecated in favor of parse_obj() method. For more details, refer to the Pydantic documentation: https://docs.pydantic.dev/usage/models/#helper-functions
- from_dict(attribute_value_mapping: dict[str, Any]) None #
Deserializes a dict into self, resetting and/or overwriting existing fields.
- Parameters:
attribute_value_mapping (dict) โ A dictionary that will be deserialized into the parent object.
Deprecated
----------
1.0.0 โ The from_dict() method is deprecated in favor of parse_obj() method. For more details, refer to the Pydantic documentation: https://docs.pydantic.dev/usage/models/#helper-functions
- to_dict() dict[str, Any] #
Returns a dict representation of self
- Returns:
dict โ A dictionary containing the data from the instance.
Deprecated
โโโ- โ The to_dict() method is deprecated in favor of dict() method. For more details, refer to the Pydantic documentation: https://docs.pydantic.dev/1.10/usage/exporting_models/
- pydantic model stravalib.model.SegmentExplorerResult[source]#
Represents a segment result from the segment explorer feature.
(These are not full segment objects, but the segment object can be fetched via the โsegmentโ property of this object.)
Show JSON schema
{ "title": "SegmentExplorerResult", "description": "Represents a segment result from the segment explorer feature.\n\n(These are not full segment objects, but the segment object can be fetched\nvia the 'segment' property of this object.)", "type": "object", "properties": { "bound_client": { "title": "Bound Client" }, "avg_grade": { "title": "Avg Grade", "type": "number" }, "climb_category": { "title": "Climb Category", "minimum": 0, "maximum": 5, "type": "integer" }, "climb_category_desc": { "title": "Climb Category Desc", "enum": [ "NC", "4", "3", "2", "1", "HC" ], "type": "string" }, "distance": { "title": "Distance", "type": "number" }, "elev_difference": { "title": "Elev Difference", "type": "number" }, "end_latlng": { "$ref": "#/definitions/LatLon" }, "id": { "title": "Id", "type": "integer" }, "name": { "title": "Name", "type": "string" }, "points": { "title": "Points", "type": "string" }, "start_latlng": { "$ref": "#/definitions/LatLon" }, "starred": { "title": "Starred", "type": "boolean" } }, "definitions": { "LatLon": { "title": "LatLon", "description": "Enables backward compatibility for legacy namedtuple", "minItems": 2, "maxItems": 2, "type": "array", "items": { "type": "number" } } } }
- Fields:
- Validators:
- field avg_grade: float | None = None#
The segmentโs average grade, in percents
- field bound_client: Any | None = None#
- field climb_category: int | None = None#
The category of the climb [0, 5]. Higher is harder ie. 5 is Hors catรฉgorie, 0 is uncategorized in climb_category. If climb_category = 5, climb_category_desc = HC. If climb_category = 2, climb_category_desc = 3.
- Constraints:
minimum = 0
maximum = 5
- field climb_category_desc: Literal['NC', '4', '3', '2', '1', 'HC'] | None = None#
The description for the category of the climb
- field distance: float | None = None#
The segmentโs distance, in meters
- field elev_difference: float | None = None#
The segmentsโs evelation difference, in meters
- field id: int | None = None#
The unique identifier of this segment
- field name: str | None = None#
The name of this segment
- field points: str | None = None#
The polyline of the segment
- field starred: bool | None = None#
- classmethod deserialize(attribute_value_mapping: dict[str, Any]) Self #
Creates and returns a new object based on serialized (dict) struct.
- Parameters:
attribute_value_mapping (dict) โ A dictionary representing the serialized data.
- Returns:
DeprecatedSerializableMixin โ A new instance of the class created from the serialized data.
Deprecated
โโโ-
1.0.0 โ The deserialize() method is deprecated in favor of parse_obj() method. For more details, refer to the Pydantic documentation: https://docs.pydantic.dev/usage/models/#helper-functions
- from_dict(attribute_value_mapping: dict[str, Any]) None #
Deserializes a dict into self, resetting and/or overwriting existing fields.
- Parameters:
attribute_value_mapping (dict) โ A dictionary that will be deserialized into the parent object.
Deprecated
----------
1.0.0 โ The from_dict() method is deprecated in favor of parse_obj() method. For more details, refer to the Pydantic documentation: https://docs.pydantic.dev/usage/models/#helper-functions
- to_dict() dict[str, Any] #
Returns a dict representation of self
- Returns:
dict โ A dictionary containing the data from the instance.
Deprecated
โโโ- โ The to_dict() method is deprecated in favor of dict() method. For more details, refer to the Pydantic documentation: https://docs.pydantic.dev/1.10/usage/exporting_models/
- property segment: Segment#
Returns the associated (full)
Segment
object.This property is lazy-loaded. Segment objects will be fetched from the bound client only when explicitly accessed for the first time.
- Returns:
The associated Segment object, if available; otherwise, returns None.
- Return type:
Segment object or None
- pydantic model stravalib.model.AthleteSegmentStats[source]#
A structure being returned for segment stats for current athlete.
Show JSON schema
{ "title": "AthleteSegmentStats", "description": "A structure being returned for segment stats for current athlete.", "type": "object", "properties": { "activity_id": { "title": "Activity Id", "type": "integer" }, "distance": { "title": "Distance", "type": "number" }, "elapsed_time": { "title": "Elapsed Time", "type": "number", "format": "time-delta" }, "id": { "title": "Id", "type": "integer" }, "is_kom": { "title": "Is Kom", "type": "boolean" }, "start_date": { "title": "Start Date", "type": "string", "format": "date-time" }, "start_date_local": { "title": "Start Date Local", "type": "string", "format": "date-time" }, "effort_count": { "title": "Effort Count", "type": "integer" }, "pr_elapsed_time": { "title": "Pr Elapsed Time", "type": "number", "format": "time-delta" }, "pr_date": { "title": "Pr Date", "type": "string", "format": "date" } } }
- Fields:
- Validators:
- field activity_id: int | None = None#
The unique identifier of the activity related to this effort
- field distance: float | None = None#
The effortโs distance in meters
- field effort_count: int | None = None#
- field elapsed_time: timedelta | None = None#
The effortโs elapsed time
- field id: int | None = None#
The unique identifier of this effort
- field is_kom: bool | None = None#
Whether this effort is the current best on the leaderboard
- field pr_date: date | None = None#
- field pr_elapsed_time: timedelta | None = None#
- field start_date: datetime | None = None#
The time at which the effort was started.
- field start_date_local: datetime | None = None#
The time at which the effort was started in the local timezone.
- Validated by:
- classmethod deserialize(attribute_value_mapping: dict[str, Any]) Self #
Creates and returns a new object based on serialized (dict) struct.
- Parameters:
attribute_value_mapping (dict) โ A dictionary representing the serialized data.
- Returns:
DeprecatedSerializableMixin โ A new instance of the class created from the serialized data.
Deprecated
โโโ-
1.0.0 โ The deserialize() method is deprecated in favor of parse_obj() method. For more details, refer to the Pydantic documentation: https://docs.pydantic.dev/usage/models/#helper-functions
- from_dict(attribute_value_mapping: dict[str, Any]) None #
Deserializes a dict into self, resetting and/or overwriting existing fields.
- Parameters:
attribute_value_mapping (dict) โ A dictionary that will be deserialized into the parent object.
Deprecated
----------
1.0.0 โ The from_dict() method is deprecated in favor of parse_obj() method. For more details, refer to the Pydantic documentation: https://docs.pydantic.dev/usage/models/#helper-functions
- to_dict() dict[str, Any] #
Returns a dict representation of self
- Returns:
dict โ A dictionary containing the data from the instance.
Deprecated
โโโ- โ The to_dict() method is deprecated in favor of dict() method. For more details, refer to the Pydantic documentation: https://docs.pydantic.dev/1.10/usage/exporting_models/
- pydantic model stravalib.model.AthletePrEffort[source]#
Show JSON schema
{ "title": "AthletePrEffort", "description": "Mixin that intercepts attribute lookup and raises warnings or modifies\nreturn values based on what is defined in the following class attributes:\n\n* _field_conversions\n\nNotes\n------\nThe class attributes below are not yet implemented:\n* _deprecated_fields (TODO)\n* _unsupported_fields (TODO)", "type": "object", "properties": { "effort_count": { "title": "Effort Count", "type": "integer" }, "pr_activity_id": { "title": "Pr Activity Id", "type": "integer" }, "pr_date": { "title": "Pr Date", "type": "string", "format": "date-time" }, "pr_elapsed_time": { "title": "Pr Elapsed Time", "type": "number", "format": "time-delta" }, "distance": { "title": "Distance", "type": "number" }, "start_date": { "title": "Start Date", "type": "string", "format": "date-time" }, "start_date_local": { "title": "Start Date Local", "type": "string", "format": "date-time" }, "is_kom": { "title": "Is Kom", "type": "boolean" } } }
- Fields:
- Validators:
- field distance: float | None = None#
- field effort_count: int | None = None#
Number of efforts by the authenticated athlete on this segment.
- field is_kom: bool | None = None#
- field pr_activity_id: int | None = None#
The unique identifier of the activity related to the PR effort.
- field pr_date: datetime | None = None#
The time at which the PR effort was started.
- field pr_elapsed_time: timedelta | None = None#
The elapsed time ot the PR effort.
- field start_date: datetime | None = None#
- field start_date_local: datetime | None = None#
- Validated by:
- classmethod deserialize(attribute_value_mapping: dict[str, Any]) Self #
Creates and returns a new object based on serialized (dict) struct.
- Parameters:
attribute_value_mapping (dict) โ A dictionary representing the serialized data.
- Returns:
DeprecatedSerializableMixin โ A new instance of the class created from the serialized data.
Deprecated
โโโ-
1.0.0 โ The deserialize() method is deprecated in favor of parse_obj() method. For more details, refer to the Pydantic documentation: https://docs.pydantic.dev/usage/models/#helper-functions
- from_dict(attribute_value_mapping: dict[str, Any]) None #
Deserializes a dict into self, resetting and/or overwriting existing fields.
- Parameters:
attribute_value_mapping (dict) โ A dictionary that will be deserialized into the parent object.
Deprecated
----------
1.0.0 โ The from_dict() method is deprecated in favor of parse_obj() method. For more details, refer to the Pydantic documentation: https://docs.pydantic.dev/usage/models/#helper-functions
- to_dict() dict[str, Any] #
Returns a dict representation of self
- Returns:
dict โ A dictionary containing the data from the instance.
Deprecated
โโโ- โ The to_dict() method is deprecated in favor of dict() method. For more details, refer to the Pydantic documentation: https://docs.pydantic.dev/1.10/usage/exporting_models/
- property elapsed_time: timedelta | None#
A property that supports backwards compatibility with the elapsed_time method used in previous versions of stravalib
- pydantic model stravalib.model.Segment[source]#
Represents a single Strava segment.
Show JSON schema
{ "title": "Segment", "description": "Represents a single Strava segment.", "type": "object", "properties": { "bound_client": { "title": "Bound Client" }, "activity_type": { "$ref": "#/definitions/RelaxedActivityType" }, "athlete_pr_effort": { "$ref": "#/definitions/AthletePrEffort" }, "athlete_segment_stats": { "$ref": "#/definitions/AthleteSegmentStats" }, "average_grade": { "title": "Average Grade", "type": "number" }, "city": { "title": "City", "type": "string" }, "climb_category": { "title": "Climb Category", "type": "integer" }, "country": { "title": "Country", "type": "string" }, "distance": { "title": "Distance", "type": "number" }, "elevation_high": { "title": "Elevation High", "type": "number" }, "elevation_low": { "title": "Elevation Low", "type": "number" }, "end_latlng": { "$ref": "#/definitions/LatLon" }, "id": { "title": "Id", "type": "integer" }, "maximum_grade": { "title": "Maximum Grade", "type": "number" }, "name": { "title": "Name", "type": "string" }, "private": { "title": "Private", "type": "boolean" }, "start_latlng": { "$ref": "#/definitions/LatLon" }, "state": { "title": "State", "type": "string" }, "athlete_count": { "title": "Athlete Count", "type": "integer" }, "created_at": { "title": "Created At", "type": "string", "format": "date-time" }, "effort_count": { "title": "Effort Count", "type": "integer" }, "hazardous": { "title": "Hazardous", "type": "boolean" }, "map": { "$ref": "#/definitions/Map" }, "star_count": { "title": "Star Count", "type": "integer" }, "total_elevation_gain": { "title": "Total Elevation Gain", "type": "number" }, "updated_at": { "title": "Updated At", "type": "string", "format": "date-time" }, "start_latitude": { "title": "Start Latitude", "type": "number" }, "end_latitude": { "title": "End Latitude", "type": "number" }, "start_longitude": { "title": "Start Longitude", "type": "number" }, "end_longitude": { "title": "End Longitude", "type": "number" }, "starred": { "title": "Starred", "type": "boolean" }, "pr_time": { "title": "Pr Time", "type": "number", "format": "time-delta" }, "starred_date": { "title": "Starred Date", "type": "string", "format": "date-time" }, "elevation_profile": { "title": "Elevation Profile", "type": "string" } }, "definitions": { "RelaxedActivityType": { "title": "RelaxedActivityType", "enum": [ "AlpineSki", "BackcountrySki", "Canoeing", "Crossfit", "EBikeRide", "Elliptical", "Golf", "Handcycle", "Hike", "IceSkate", "InlineSkate", "Kayaking", "Kitesurf", "NordicSki", "Ride", "RockClimbing", "RollerSki", "Rowing", "Run", "Sail", "Skateboard", "Snowboard", "Snowshoe", "Soccer", "StairStepper", "StandUpPaddling", "Surfing", "Swim", "Velomobile", "VirtualRide", "VirtualRun", "Walk", "WeightTraining", "Wheelchair", "Windsurf", "Workout", "Yoga" ], "type": "string" }, "AthletePrEffort": { "title": "AthletePrEffort", "description": "Mixin that intercepts attribute lookup and raises warnings or modifies\nreturn values based on what is defined in the following class attributes:\n\n* _field_conversions\n\nNotes\n------\nThe class attributes below are not yet implemented:\n* _deprecated_fields (TODO)\n* _unsupported_fields (TODO)", "type": "object", "properties": { "effort_count": { "title": "Effort Count", "type": "integer" }, "pr_activity_id": { "title": "Pr Activity Id", "type": "integer" }, "pr_date": { "title": "Pr Date", "type": "string", "format": "date-time" }, "pr_elapsed_time": { "title": "Pr Elapsed Time", "type": "number", "format": "time-delta" }, "distance": { "title": "Distance", "type": "number" }, "start_date": { "title": "Start Date", "type": "string", "format": "date-time" }, "start_date_local": { "title": "Start Date Local", "type": "string", "format": "date-time" }, "is_kom": { "title": "Is Kom", "type": "boolean" } } }, "AthleteSegmentStats": { "title": "AthleteSegmentStats", "description": "A structure being returned for segment stats for current athlete.", "type": "object", "properties": { "activity_id": { "title": "Activity Id", "type": "integer" }, "distance": { "title": "Distance", "type": "number" }, "elapsed_time": { "title": "Elapsed Time", "type": "number", "format": "time-delta" }, "id": { "title": "Id", "type": "integer" }, "is_kom": { "title": "Is Kom", "type": "boolean" }, "start_date": { "title": "Start Date", "type": "string", "format": "date-time" }, "start_date_local": { "title": "Start Date Local", "type": "string", "format": "date-time" }, "effort_count": { "title": "Effort Count", "type": "integer" }, "pr_elapsed_time": { "title": "Pr Elapsed Time", "type": "number", "format": "time-delta" }, "pr_date": { "title": "Pr Date", "type": "string", "format": "date" } } }, "LatLon": { "title": "LatLon", "description": "Enables backward compatibility for legacy namedtuple", "minItems": 2, "maxItems": 2, "type": "array", "items": { "type": "number" } }, "Map": { "title": "Map", "description": "Pass through object. Inherits from PolyLineMap", "type": "object", "properties": { "id": { "title": "Id", "type": "string" }, "polyline": { "title": "Polyline", "type": "string" }, "summary_polyline": { "title": "Summary Polyline", "type": "string" } } } } }
- Fields:
- Validators:
- field activity_type: RelaxedActivityType | None = None#
- field athlete_count: int | None = None#
The number of unique athletes who have an effort for this segment
- field athlete_pr_effort: AthletePrEffort | None = None#
- field athlete_segment_stats: AthleteSegmentStats | None = None#
- field average_grade: float | None = None#
The segmentโs average grade, in percents
- field bound_client: Any | None = None#
- field city: str | None = None#
The segmentsโs city.
- field climb_category: int | None = None#
The category of the climb [0, 5]. Higher is harder ie. 5 is Hors catรฉgorie, 0 is uncategorized in climb_category.
- field country: str | None = None#
The segmentโs country.
- field created_at: datetime | None = None#
The time at which the segment was created.
- field distance: float | None = None#
The segmentโs distance, in meters
- field effort_count: int | None = None#
The total number of efforts for this segment
- field elevation_high: float | None = None#
The segmentsโs highest elevation, in meters
- field elevation_low: float | None = None#
The segmentsโs lowest elevation, in meters
- field elevation_profile: str | None = None#
- field end_latitude: float | None = None#
- field end_longitude: float | None = None#
- field hazardous: bool | None = None#
Whether this segment is considered hazardous
- field id: int | None = None#
The unique identifier of this segment
- field maximum_grade: float | None = None#
The segmentsโs maximum grade, in percents
- field name: str | None = None#
The name of this segment
- field pr_time: timedelta | None = None#
- field private: bool | None = None#
Whether this segment is private.
- field star_count: int | None = None#
The number of stars for this segment
- field starred: bool | None = None#
- field starred_date: datetime | None = None#
- field start_latitude: float | None = None#
- field start_longitude: float | None = None#
- field state: str | None = None#
The segmentsโs state or geographical region.
- field total_elevation_gain: float | None = None#
The segmentโs total elevation gain.
- field updated_at: datetime | None = None#
The time at which the segment was last updated.
- classmethod deserialize(attribute_value_mapping: dict[str, Any]) Self #
Creates and returns a new object based on serialized (dict) struct.
- Parameters:
attribute_value_mapping (dict) โ A dictionary representing the serialized data.
- Returns:
DeprecatedSerializableMixin โ A new instance of the class created from the serialized data.
Deprecated
โโโ-
1.0.0 โ The deserialize() method is deprecated in favor of parse_obj() method. For more details, refer to the Pydantic documentation: https://docs.pydantic.dev/usage/models/#helper-functions
- from_dict(attribute_value_mapping: dict[str, Any]) None #
Deserializes a dict into self, resetting and/or overwriting existing fields.
- Parameters:
attribute_value_mapping (dict) โ A dictionary that will be deserialized into the parent object.
Deprecated
----------
1.0.0 โ The from_dict() method is deprecated in favor of parse_obj() method. For more details, refer to the Pydantic documentation: https://docs.pydantic.dev/usage/models/#helper-functions
- to_dict() dict[str, Any] #
Returns a dict representation of self
- Returns:
dict โ A dictionary containing the data from the instance.
Deprecated
โโโ- โ The to_dict() method is deprecated in favor of dict() method. For more details, refer to the Pydantic documentation: https://docs.pydantic.dev/1.10/usage/exporting_models/
- pydantic model stravalib.model.SegmentEffortAchievement[source]#
An undocumented structure being returned for segment efforts.
Notes
Undocumented Strava elements can change at any time without notice.
Show JSON schema
{ "title": "SegmentEffortAchievement", "description": "An undocumented structure being returned for segment efforts.\n\nNotes\n-----\nUndocumented Strava elements can change at any time without notice.", "type": "object", "properties": { "rank": { "title": "Rank", "type": "integer" }, "type": { "title": "Type", "type": "string" }, "type_id": { "title": "Type Id", "type": "integer" }, "effort_count": { "title": "Effort Count", "type": "integer" } } }
- field effort_count: int | None = None#
- field rank: int | None = None#
Rank in segment (either overall leader board, or pr rank)
- field type: str | None = None#
The type of achievement โ e.g. โyear_prโ or โoverallโ
- field type_id: int | None = None#
Numeric ID for type of achievement? (6 = year_pr, 2 = overall ??? other?)
- pydantic model stravalib.model.BaseEffort[source]#
Base class for a best effort or segment effort.
Show JSON schema
{ "title": "BaseEffort", "description": "Base class for a best effort or segment effort.", "type": "object", "properties": { "bound_client": { "title": "Bound Client" }, "activity_id": { "title": "Activity Id", "type": "integer" }, "distance": { "title": "Distance", "type": "number" }, "elapsed_time": { "title": "Elapsed Time", "type": "number", "format": "time-delta" }, "id": { "title": "Id", "type": "integer" }, "is_kom": { "title": "Is Kom", "type": "boolean" }, "start_date": { "title": "Start Date", "type": "string", "format": "date-time" }, "start_date_local": { "title": "Start Date Local", "type": "string", "format": "date-time" }, "activity": { "title": "Activity" }, "athlete": { "$ref": "#/definitions/Athlete" }, "average_cadence": { "title": "Average Cadence", "type": "number" }, "average_heartrate": { "title": "Average Heartrate", "type": "number" }, "average_watts": { "title": "Average Watts", "type": "number" }, "device_watts": { "title": "Device Watts", "type": "boolean" }, "end_index": { "title": "End Index", "type": "integer" }, "hidden": { "title": "Hidden", "type": "boolean" }, "kom_rank": { "title": "Kom Rank", "minimum": 1, "maximum": 10, "type": "integer" }, "max_heartrate": { "title": "Max Heartrate", "type": "number" }, "moving_time": { "title": "Moving Time", "type": "number", "format": "time-delta" }, "name": { "title": "Name", "type": "string" }, "pr_rank": { "title": "Pr Rank", "minimum": 1, "maximum": 3, "type": "integer" }, "segment": { "$ref": "#/definitions/Segment" }, "start_index": { "title": "Start Index", "type": "integer" } }, "definitions": { "SummaryGear": { "title": "SummaryGear", "type": "object", "properties": { "distance": { "title": "Distance", "type": "number" }, "id": { "title": "Id", "type": "string" }, "name": { "title": "Name", "type": "string" }, "primary": { "title": "Primary", "type": "boolean" }, "resource_state": { "title": "Resource State", "type": "integer" } } }, "ActivityType": { "title": "ActivityType", "enum": [ "AlpineSki", "BackcountrySki", "Canoeing", "Crossfit", "EBikeRide", "Elliptical", "Golf", "Handcycle", "Hike", "IceSkate", "InlineSkate", "Kayaking", "Kitesurf", "NordicSki", "Ride", "RockClimbing", "RollerSki", "Rowing", "Run", "Sail", "Skateboard", "Snowboard", "Snowshoe", "Soccer", "StairStepper", "StandUpPaddling", "Surfing", "Swim", "Velomobile", "VirtualRide", "VirtualRun", "Walk", "WeightTraining", "Wheelchair", "Windsurf", "Workout", "Yoga" ], "type": "string" }, "SummaryClub": { "title": "SummaryClub", "type": "object", "properties": { "id": { "title": "Id", "type": "integer" }, "name": { "title": "Name", "type": "string" }, "resource_state": { "title": "Resource State", "type": "integer" }, "activity_types": { "title": "Activity Types", "type": "array", "items": { "$ref": "#/definitions/ActivityType" } }, "city": { "title": "City", "type": "string" }, "country": { "title": "Country", "type": "string" }, "cover_photo": { "title": "Cover Photo", "type": "string" }, "cover_photo_small": { "title": "Cover Photo Small", "type": "string" }, "featured": { "title": "Featured", "type": "boolean" }, "member_count": { "title": "Member Count", "type": "integer" }, "private": { "title": "Private", "type": "boolean" }, "profile_medium": { "title": "Profile Medium", "type": "string" }, "sport_type": { "title": "Sport Type", "enum": [ "cycling", "running", "triathlon", "other" ], "type": "string" }, "state": { "title": "State", "type": "string" }, "url": { "title": "Url", "type": "string" }, "verified": { "title": "Verified", "type": "boolean" } } }, "Athlete": { "title": "Athlete", "description": "Represents high level athlete information including\ntheir name, email, clubs they belong to, bikes, shoes, etc.\n\nNotes\n------\nAlso provides access to detailed athlete stats upon request.\nMany attributes in this object are undocumented by Strava and could be\nmodified at any time.", "type": "object", "properties": { "bound_client": { "title": "Bound Client" }, "id": { "title": "Id", "type": "integer" }, "city": { "title": "City", "type": "string" }, "country": { "title": "Country", "type": "string" }, "created_at": { "title": "Created At", "type": "string", "format": "date-time" }, "firstname": { "title": "Firstname", "type": "string" }, "lastname": { "title": "Lastname", "type": "string" }, "premium": { "title": "Premium", "type": "boolean" }, "profile": { "title": "Profile", "type": "string" }, "profile_medium": { "title": "Profile Medium", "type": "string" }, "resource_state": { "title": "Resource State", "type": "integer" }, "sex": { "title": "Sex", "enum": [ "M", "F" ], "type": "string" }, "state": { "title": "State", "type": "string" }, "summit": { "title": "Summit", "type": "boolean" }, "updated_at": { "title": "Updated At", "type": "string", "format": "date-time" }, "bikes": { "title": "Bikes", "type": "array", "items": { "$ref": "#/definitions/SummaryGear" } }, "clubs": { "title": "Clubs", "type": "array", "items": { "$ref": "#/definitions/SummaryClub" } }, "follower_count": { "title": "Follower Count", "type": "integer" }, "friend_count": { "title": "Friend Count", "type": "integer" }, "ftp": { "title": "Ftp", "type": "integer" }, "measurement_preference": { "title": "Measurement Preference", "enum": [ "feet", "meters" ], "type": "string" }, "shoes": { "title": "Shoes", "type": "array", "items": { "$ref": "#/definitions/SummaryGear" } }, "weight": { "title": "Weight", "type": "number" }, "is_authenticated": { "title": "Is Authenticated", "type": "boolean" }, "athlete_type": { "title": "Athlete Type", "enum": [ "cyclist", "runner" ], "type": "string" }, "friend": { "title": "Friend", "type": "string" }, "follower": { "title": "Follower", "type": "string" }, "approve_followers": { "title": "Approve Followers", "type": "boolean" }, "badge_type_id": { "title": "Badge Type Id", "type": "integer" }, "mutual_friend_count": { "title": "Mutual Friend Count", "type": "integer" }, "date_preference": { "title": "Date Preference", "type": "string" }, "email": { "title": "Email", "type": "string" }, "super_user": { "title": "Super User", "type": "boolean" }, "email_language": { "title": "Email Language", "type": "string" }, "max_heartrate": { "title": "Max Heartrate", "type": "number" }, "username": { "title": "Username", "type": "string" }, "description": { "title": "Description", "type": "string" }, "instagram_username": { "title": "Instagram Username", "type": "string" }, "offer_in_app_payment": { "title": "Offer In App Payment", "type": "boolean" }, "global_privacy": { "title": "Global Privacy", "type": "boolean" }, "receive_newsletter": { "title": "Receive Newsletter", "type": "boolean" }, "email_kom_lost": { "title": "Email Kom Lost", "type": "boolean" }, "dateofbirth": { "title": "Dateofbirth", "type": "string", "format": "date" }, "facebook_sharing_enabled": { "title": "Facebook Sharing Enabled", "type": "boolean" }, "profile_original": { "title": "Profile Original", "type": "string" }, "premium_expiration_date": { "title": "Premium Expiration Date", "type": "integer" }, "email_send_follower_notices": { "title": "Email Send Follower Notices", "type": "boolean" }, "plan": { "title": "Plan", "type": "string" }, "agreed_to_terms": { "title": "Agreed To Terms", "type": "string" }, "follower_request_count": { "title": "Follower Request Count", "type": "integer" }, "email_facebook_twitter_friend_joins": { "title": "Email Facebook Twitter Friend Joins", "type": "boolean" }, "receive_kudos_emails": { "title": "Receive Kudos Emails", "type": "boolean" }, "receive_follower_feed_emails": { "title": "Receive Follower Feed Emails", "type": "boolean" }, "receive_comment_emails": { "title": "Receive Comment Emails", "type": "boolean" }, "sample_race_distance": { "title": "Sample Race Distance", "type": "integer" }, "sample_race_time": { "title": "Sample Race Time", "type": "integer" }, "membership": { "title": "Membership", "type": "string" }, "admin": { "title": "Admin", "type": "boolean" }, "owner": { "title": "Owner", "type": "boolean" }, "subscription_permissions": { "title": "Subscription Permissions", "type": "array", "items": { "type": "boolean" } } } }, "RelaxedActivityType": { "title": "RelaxedActivityType", "enum": [ "AlpineSki", "BackcountrySki", "Canoeing", "Crossfit", "EBikeRide", "Elliptical", "Golf", "Handcycle", "Hike", "IceSkate", "InlineSkate", "Kayaking", "Kitesurf", "NordicSki", "Ride", "RockClimbing", "RollerSki", "Rowing", "Run", "Sail", "Skateboard", "Snowboard", "Snowshoe", "Soccer", "StairStepper", "StandUpPaddling", "Surfing", "Swim", "Velomobile", "VirtualRide", "VirtualRun", "Walk", "WeightTraining", "Wheelchair", "Windsurf", "Workout", "Yoga" ], "type": "string" }, "AthletePrEffort": { "title": "AthletePrEffort", "description": "Mixin that intercepts attribute lookup and raises warnings or modifies\nreturn values based on what is defined in the following class attributes:\n\n* _field_conversions\n\nNotes\n------\nThe class attributes below are not yet implemented:\n* _deprecated_fields (TODO)\n* _unsupported_fields (TODO)", "type": "object", "properties": { "effort_count": { "title": "Effort Count", "type": "integer" }, "pr_activity_id": { "title": "Pr Activity Id", "type": "integer" }, "pr_date": { "title": "Pr Date", "type": "string", "format": "date-time" }, "pr_elapsed_time": { "title": "Pr Elapsed Time", "type": "number", "format": "time-delta" }, "distance": { "title": "Distance", "type": "number" }, "start_date": { "title": "Start Date", "type": "string", "format": "date-time" }, "start_date_local": { "title": "Start Date Local", "type": "string", "format": "date-time" }, "is_kom": { "title": "Is Kom", "type": "boolean" } } }, "AthleteSegmentStats": { "title": "AthleteSegmentStats", "description": "A structure being returned for segment stats for current athlete.", "type": "object", "properties": { "activity_id": { "title": "Activity Id", "type": "integer" }, "distance": { "title": "Distance", "type": "number" }, "elapsed_time": { "title": "Elapsed Time", "type": "number", "format": "time-delta" }, "id": { "title": "Id", "type": "integer" }, "is_kom": { "title": "Is Kom", "type": "boolean" }, "start_date": { "title": "Start Date", "type": "string", "format": "date-time" }, "start_date_local": { "title": "Start Date Local", "type": "string", "format": "date-time" }, "effort_count": { "title": "Effort Count", "type": "integer" }, "pr_elapsed_time": { "title": "Pr Elapsed Time", "type": "number", "format": "time-delta" }, "pr_date": { "title": "Pr Date", "type": "string", "format": "date" } } }, "LatLon": { "title": "LatLon", "description": "Enables backward compatibility for legacy namedtuple", "minItems": 2, "maxItems": 2, "type": "array", "items": { "type": "number" } }, "Map": { "title": "Map", "description": "Pass through object. Inherits from PolyLineMap", "type": "object", "properties": { "id": { "title": "Id", "type": "string" }, "polyline": { "title": "Polyline", "type": "string" }, "summary_polyline": { "title": "Summary Polyline", "type": "string" } } }, "Segment": { "title": "Segment", "description": "Represents a single Strava segment.", "type": "object", "properties": { "bound_client": { "title": "Bound Client" }, "activity_type": { "$ref": "#/definitions/RelaxedActivityType" }, "athlete_pr_effort": { "$ref": "#/definitions/AthletePrEffort" }, "athlete_segment_stats": { "$ref": "#/definitions/AthleteSegmentStats" }, "average_grade": { "title": "Average Grade", "type": "number" }, "city": { "title": "City", "type": "string" }, "climb_category": { "title": "Climb Category", "type": "integer" }, "country": { "title": "Country", "type": "string" }, "distance": { "title": "Distance", "type": "number" }, "elevation_high": { "title": "Elevation High", "type": "number" }, "elevation_low": { "title": "Elevation Low", "type": "number" }, "end_latlng": { "$ref": "#/definitions/LatLon" }, "id": { "title": "Id", "type": "integer" }, "maximum_grade": { "title": "Maximum Grade", "type": "number" }, "name": { "title": "Name", "type": "string" }, "private": { "title": "Private", "type": "boolean" }, "start_latlng": { "$ref": "#/definitions/LatLon" }, "state": { "title": "State", "type": "string" }, "athlete_count": { "title": "Athlete Count", "type": "integer" }, "created_at": { "title": "Created At", "type": "string", "format": "date-time" }, "effort_count": { "title": "Effort Count", "type": "integer" }, "hazardous": { "title": "Hazardous", "type": "boolean" }, "map": { "$ref": "#/definitions/Map" }, "star_count": { "title": "Star Count", "type": "integer" }, "total_elevation_gain": { "title": "Total Elevation Gain", "type": "number" }, "updated_at": { "title": "Updated At", "type": "string", "format": "date-time" }, "start_latitude": { "title": "Start Latitude", "type": "number" }, "end_latitude": { "title": "End Latitude", "type": "number" }, "start_longitude": { "title": "Start Longitude", "type": "number" }, "end_longitude": { "title": "End Longitude", "type": "number" }, "starred": { "title": "Starred", "type": "boolean" }, "pr_time": { "title": "Pr Time", "type": "number", "format": "time-delta" }, "starred_date": { "title": "Starred Date", "type": "string", "format": "date-time" }, "elevation_profile": { "title": "Elevation Profile", "type": "string" } } } } }
- Fields:
- Validators:
- field activity_id: int | None = None#
The unique identifier of the activity related to this effort
- field average_cadence: float | None = None#
The effortโs average cadence
- field average_heartrate: float | None = None#
The heart heart rate of the athlete during this effort
- field average_watts: float | None = None#
The average wattage of this effort
- field bound_client: Any | None = None#
- field device_watts: bool | None = None#
For riding efforts, whether the wattage was reported by a dedicated recording device
- field distance: float | None = None#
The effortโs distance in meters
- field elapsed_time: timedelta | None = None#
The effortโs elapsed time
- field end_index: int | None = None#
The end index of this effort in its activityโs stream
Whether this effort should be hidden when viewed within an activity
- field id: int | None = None#
The unique identifier of this effort
- field is_kom: bool | None = None#
Whether this effort is the current best on the leaderboard
- field kom_rank: int | None = None#
The rank of the effort on the global leaderboard if it belongs in the top 10 at the time of upload
- Constraints:
minimum = 1
maximum = 10
- field max_heartrate: float | None = None#
The maximum heart rate of the athlete during this effort
- field moving_time: timedelta | None = None#
The effortโs moving time
- field name: str | None = None#
The name of the segment on which this effort was performed
- field pr_rank: int | None = None#
The rank of the effort on the athleteโs leaderboard if it belongs in the top 3 at the time of upload
- Constraints:
minimum = 1
maximum = 3
- field start_date: datetime | None = None#
The time at which the effort was started.
- field start_date_local: datetime | None = None#
The time at which the effort was started in the local timezone.
- Validated by:
- field start_index: int | None = None#
The start index of this effort in its activityโs stream
- classmethod deserialize(attribute_value_mapping: dict[str, Any]) Self #
Creates and returns a new object based on serialized (dict) struct.
- Parameters:
attribute_value_mapping (dict) โ A dictionary representing the serialized data.
- Returns:
DeprecatedSerializableMixin โ A new instance of the class created from the serialized data.
Deprecated
โโโ-
1.0.0 โ The deserialize() method is deprecated in favor of parse_obj() method. For more details, refer to the Pydantic documentation: https://docs.pydantic.dev/usage/models/#helper-functions
- from_dict(attribute_value_mapping: dict[str, Any]) None #
Deserializes a dict into self, resetting and/or overwriting existing fields.
- Parameters:
attribute_value_mapping (dict) โ A dictionary that will be deserialized into the parent object.
Deprecated
----------
1.0.0 โ The from_dict() method is deprecated in favor of parse_obj() method. For more details, refer to the Pydantic documentation: https://docs.pydantic.dev/usage/models/#helper-functions
- to_dict() dict[str, Any] #
Returns a dict representation of self
- Returns:
dict โ A dictionary containing the data from the instance.
Deprecated
โโโ- โ The to_dict() method is deprecated in favor of dict() method. For more details, refer to the Pydantic documentation: https://docs.pydantic.dev/1.10/usage/exporting_models/
- pydantic model stravalib.model.BestEffort[source]#
Class representing a best effort (e.g. best time for 5k)
Show JSON schema
{ "$ref": "#/definitions/BestEffort", "definitions": { "SummaryGear": { "title": "SummaryGear", "type": "object", "properties": { "distance": { "title": "Distance", "type": "number" }, "id": { "title": "Id", "type": "string" }, "name": { "title": "Name", "type": "string" }, "primary": { "title": "Primary", "type": "boolean" }, "resource_state": { "title": "Resource State", "type": "integer" } } }, "ActivityType": { "title": "ActivityType", "enum": [ "AlpineSki", "BackcountrySki", "Canoeing", "Crossfit", "EBikeRide", "Elliptical", "Golf", "Handcycle", "Hike", "IceSkate", "InlineSkate", "Kayaking", "Kitesurf", "NordicSki", "Ride", "RockClimbing", "RollerSki", "Rowing", "Run", "Sail", "Skateboard", "Snowboard", "Snowshoe", "Soccer", "StairStepper", "StandUpPaddling", "Surfing", "Swim", "Velomobile", "VirtualRide", "VirtualRun", "Walk", "WeightTraining", "Wheelchair", "Windsurf", "Workout", "Yoga" ], "type": "string" }, "SummaryClub": { "title": "SummaryClub", "type": "object", "properties": { "id": { "title": "Id", "type": "integer" }, "name": { "title": "Name", "type": "string" }, "resource_state": { "title": "Resource State", "type": "integer" }, "activity_types": { "title": "Activity Types", "type": "array", "items": { "$ref": "#/definitions/ActivityType" } }, "city": { "title": "City", "type": "string" }, "country": { "title": "Country", "type": "string" }, "cover_photo": { "title": "Cover Photo", "type": "string" }, "cover_photo_small": { "title": "Cover Photo Small", "type": "string" }, "featured": { "title": "Featured", "type": "boolean" }, "member_count": { "title": "Member Count", "type": "integer" }, "private": { "title": "Private", "type": "boolean" }, "profile_medium": { "title": "Profile Medium", "type": "string" }, "sport_type": { "title": "Sport Type", "enum": [ "cycling", "running", "triathlon", "other" ], "type": "string" }, "state": { "title": "State", "type": "string" }, "url": { "title": "Url", "type": "string" }, "verified": { "title": "Verified", "type": "boolean" } } }, "Athlete": { "title": "Athlete", "description": "Represents high level athlete information including\ntheir name, email, clubs they belong to, bikes, shoes, etc.\n\nNotes\n------\nAlso provides access to detailed athlete stats upon request.\nMany attributes in this object are undocumented by Strava and could be\nmodified at any time.", "type": "object", "properties": { "bound_client": { "title": "Bound Client" }, "id": { "title": "Id", "type": "integer" }, "city": { "title": "City", "type": "string" }, "country": { "title": "Country", "type": "string" }, "created_at": { "title": "Created At", "type": "string", "format": "date-time" }, "firstname": { "title": "Firstname", "type": "string" }, "lastname": { "title": "Lastname", "type": "string" }, "premium": { "title": "Premium", "type": "boolean" }, "profile": { "title": "Profile", "type": "string" }, "profile_medium": { "title": "Profile Medium", "type": "string" }, "resource_state": { "title": "Resource State", "type": "integer" }, "sex": { "title": "Sex", "enum": [ "M", "F" ], "type": "string" }, "state": { "title": "State", "type": "string" }, "summit": { "title": "Summit", "type": "boolean" }, "updated_at": { "title": "Updated At", "type": "string", "format": "date-time" }, "bikes": { "title": "Bikes", "type": "array", "items": { "$ref": "#/definitions/SummaryGear" } }, "clubs": { "title": "Clubs", "type": "array", "items": { "$ref": "#/definitions/SummaryClub" } }, "follower_count": { "title": "Follower Count", "type": "integer" }, "friend_count": { "title": "Friend Count", "type": "integer" }, "ftp": { "title": "Ftp", "type": "integer" }, "measurement_preference": { "title": "Measurement Preference", "enum": [ "feet", "meters" ], "type": "string" }, "shoes": { "title": "Shoes", "type": "array", "items": { "$ref": "#/definitions/SummaryGear" } }, "weight": { "title": "Weight", "type": "number" }, "is_authenticated": { "title": "Is Authenticated", "type": "boolean" }, "athlete_type": { "title": "Athlete Type", "enum": [ "cyclist", "runner" ], "type": "string" }, "friend": { "title": "Friend", "type": "string" }, "follower": { "title": "Follower", "type": "string" }, "approve_followers": { "title": "Approve Followers", "type": "boolean" }, "badge_type_id": { "title": "Badge Type Id", "type": "integer" }, "mutual_friend_count": { "title": "Mutual Friend Count", "type": "integer" }, "date_preference": { "title": "Date Preference", "type": "string" }, "email": { "title": "Email", "type": "string" }, "super_user": { "title": "Super User", "type": "boolean" }, "email_language": { "title": "Email Language", "type": "string" }, "max_heartrate": { "title": "Max Heartrate", "type": "number" }, "username": { "title": "Username", "type": "string" }, "description": { "title": "Description", "type": "string" }, "instagram_username": { "title": "Instagram Username", "type": "string" }, "offer_in_app_payment": { "title": "Offer In App Payment", "type": "boolean" }, "global_privacy": { "title": "Global Privacy", "type": "boolean" }, "receive_newsletter": { "title": "Receive Newsletter", "type": "boolean" }, "email_kom_lost": { "title": "Email Kom Lost", "type": "boolean" }, "dateofbirth": { "title": "Dateofbirth", "type": "string", "format": "date" }, "facebook_sharing_enabled": { "title": "Facebook Sharing Enabled", "type": "boolean" }, "profile_original": { "title": "Profile Original", "type": "string" }, "premium_expiration_date": { "title": "Premium Expiration Date", "type": "integer" }, "email_send_follower_notices": { "title": "Email Send Follower Notices", "type": "boolean" }, "plan": { "title": "Plan", "type": "string" }, "agreed_to_terms": { "title": "Agreed To Terms", "type": "string" }, "follower_request_count": { "title": "Follower Request Count", "type": "integer" }, "email_facebook_twitter_friend_joins": { "title": "Email Facebook Twitter Friend Joins", "type": "boolean" }, "receive_kudos_emails": { "title": "Receive Kudos Emails", "type": "boolean" }, "receive_follower_feed_emails": { "title": "Receive Follower Feed Emails", "type": "boolean" }, "receive_comment_emails": { "title": "Receive Comment Emails", "type": "boolean" }, "sample_race_distance": { "title": "Sample Race Distance", "type": "integer" }, "sample_race_time": { "title": "Sample Race Time", "type": "integer" }, "membership": { "title": "Membership", "type": "string" }, "admin": { "title": "Admin", "type": "boolean" }, "owner": { "title": "Owner", "type": "boolean" }, "subscription_permissions": { "title": "Subscription Permissions", "type": "array", "items": { "type": "boolean" } } } }, "LatLon": { "title": "LatLon", "description": "Enables backward compatibility for legacy namedtuple", "minItems": 2, "maxItems": 2, "type": "array", "items": { "type": "number" } }, "Map": { "title": "Map", "description": "Pass through object. Inherits from PolyLineMap", "type": "object", "properties": { "id": { "title": "Id", "type": "string" }, "polyline": { "title": "Polyline", "type": "string" }, "summary_polyline": { "title": "Summary Polyline", "type": "string" } } }, "RelaxedSportType": { "title": "RelaxedSportType", "enum": [ "AlpineSki", "BackcountrySki", "Badminton", "Canoeing", "Crossfit", "EBikeRide", "Elliptical", "EMountainBikeRide", "Golf", "GravelRide", "Handcycle", "HighIntensityIntervalTraining", "Hike", "IceSkate", "InlineSkate", "Kayaking", "Kitesurf", "MountainBikeRide", "NordicSki", "Pickleball", "Pilates", "Racquetball", "Ride", "RockClimbing", "RollerSki", "Rowing", "Run", "Sail", "Skateboard", "Snowboard", "Snowshoe", "Soccer", "Squash", "StairStepper", "StandUpPaddling", "Surfing", "Swim", "TableTennis", "Tennis", "TrailRun", "Velomobile", "VirtualRide", "VirtualRow", "VirtualRun", "Walk", "WeightTraining", "Wheelchair", "Windsurf", "Workout", "Yoga" ], "type": "string" }, "RelaxedActivityType": { "title": "RelaxedActivityType", "enum": [ "AlpineSki", "BackcountrySki", "Canoeing", "Crossfit", "EBikeRide", "Elliptical", "Golf", "Handcycle", "Hike", "IceSkate", "InlineSkate", "Kayaking", "Kitesurf", "NordicSki", "Ride", "RockClimbing", "RollerSki", "Rowing", "Run", "Sail", "Skateboard", "Snowboard", "Snowshoe", "Soccer", "StairStepper", "StandUpPaddling", "Surfing", "Swim", "Velomobile", "VirtualRide", "VirtualRun", "Walk", "WeightTraining", "Wheelchair", "Windsurf", "Workout", "Yoga" ], "type": "string" }, "Gear": { "title": "Gear", "description": "Represents a piece of gear (equipment) used in physical activities.", "type": "object", "properties": { "distance": { "title": "Distance", "type": "number" }, "id": { "title": "Id", "type": "string" }, "name": { "title": "Name", "type": "string" }, "primary": { "title": "Primary", "type": "boolean" }, "resource_state": { "title": "Resource State", "type": "integer" }, "brand_name": { "title": "Brand Name", "type": "string" }, "description": { "title": "Description", "type": "string" }, "frame_type": { "title": "Frame Type", "type": "integer" }, "model_name": { "title": "Model Name", "type": "string" } } }, "MetaActivity": { "title": "MetaActivity", "type": "object", "properties": { "id": { "title": "Id", "type": "integer" } } }, "MetaAthlete": { "title": "MetaAthlete", "type": "object", "properties": { "id": { "title": "Id", "type": "integer" } } }, "Lap": { "title": "Lap", "type": "object", "properties": { "activity": { "$ref": "#/definitions/MetaActivity" }, "athlete": { "$ref": "#/definitions/MetaAthlete" }, "average_cadence": { "title": "Average Cadence", "type": "number" }, "average_speed": { "title": "Average Speed", "type": "number" }, "distance": { "title": "Distance", "type": "number" }, "elapsed_time": { "title": "Elapsed Time", "type": "integer" }, "end_index": { "title": "End Index", "type": "integer" }, "id": { "title": "Id", "type": "integer" }, "lap_index": { "title": "Lap Index", "type": "integer" }, "max_speed": { "title": "Max Speed", "type": "number" }, "moving_time": { "title": "Moving Time", "type": "integer" }, "name": { "title": "Name", "type": "string" }, "pace_zone": { "title": "Pace Zone", "type": "integer" }, "split": { "title": "Split", "type": "integer" }, "start_date": { "title": "Start Date", "type": "string", "format": "date-time" }, "start_date_local": { "title": "Start Date Local", "type": "string", "format": "date-time" }, "start_index": { "title": "Start Index", "type": "integer" }, "total_elevation_gain": { "title": "Total Elevation Gain", "type": "number" } } }, "ActivityPhotoPrimary": { "title": "ActivityPhotoPrimary", "description": "Represents the primary photo for an activity.\n\nAttributes\n----------\nuse_primary_photo : bool, optional\n Indicates whether the photo is used as the primary photo.\n\nNotes\n-----\nAttributes for activity photos are currently undocumented.", "type": "object", "properties": { "id": { "title": "Id", "type": "integer" }, "source": { "title": "Source", "type": "integer" }, "unique_id": { "title": "Unique Id", "type": "string" }, "urls": { "title": "Urls", "type": "object", "additionalProperties": { "type": "string" } }, "use_primary_photo": { "title": "Use Primary Photo", "type": "boolean" } } }, "ActivityPhotoMeta": { "title": "ActivityPhotoMeta", "description": "Represents the metadata of photos returned with the activity.\n\nNot to be confused with the fully loaded photos for an activity.\n\nAttributes\n----------\nprimary : ActivityPhotoPrimary, optional\n The primary photo for the activity.\nuse_primary_photo : bool, optional\n Indicates whether the primary photo is used. Not currently documented\n by Strava.\n\nNotes\n-----\nUndocumented attributes could be changed by Strava at any time.", "type": "object", "properties": { "count": { "title": "Count", "type": "integer" }, "primary": { "$ref": "#/definitions/ActivityPhotoPrimary" }, "use_primary_photo": { "title": "Use Primary Photo", "type": "boolean" } } }, "AthletePrEffort": { "title": "AthletePrEffort", "description": "Mixin that intercepts attribute lookup and raises warnings or modifies\nreturn values based on what is defined in the following class attributes:\n\n* _field_conversions\n\nNotes\n------\nThe class attributes below are not yet implemented:\n* _deprecated_fields (TODO)\n* _unsupported_fields (TODO)", "type": "object", "properties": { "effort_count": { "title": "Effort Count", "type": "integer" }, "pr_activity_id": { "title": "Pr Activity Id", "type": "integer" }, "pr_date": { "title": "Pr Date", "type": "string", "format": "date-time" }, "pr_elapsed_time": { "title": "Pr Elapsed Time", "type": "number", "format": "time-delta" }, "distance": { "title": "Distance", "type": "number" }, "start_date": { "title": "Start Date", "type": "string", "format": "date-time" }, "start_date_local": { "title": "Start Date Local", "type": "string", "format": "date-time" }, "is_kom": { "title": "Is Kom", "type": "boolean" } } }, "AthleteSegmentStats": { "title": "AthleteSegmentStats", "description": "A structure being returned for segment stats for current athlete.", "type": "object", "properties": { "activity_id": { "title": "Activity Id", "type": "integer" }, "distance": { "title": "Distance", "type": "number" }, "elapsed_time": { "title": "Elapsed Time", "type": "number", "format": "time-delta" }, "id": { "title": "Id", "type": "integer" }, "is_kom": { "title": "Is Kom", "type": "boolean" }, "start_date": { "title": "Start Date", "type": "string", "format": "date-time" }, "start_date_local": { "title": "Start Date Local", "type": "string", "format": "date-time" }, "effort_count": { "title": "Effort Count", "type": "integer" }, "pr_elapsed_time": { "title": "Pr Elapsed Time", "type": "number", "format": "time-delta" }, "pr_date": { "title": "Pr Date", "type": "string", "format": "date" } } }, "Segment": { "title": "Segment", "description": "Represents a single Strava segment.", "type": "object", "properties": { "bound_client": { "title": "Bound Client" }, "activity_type": { "$ref": "#/definitions/RelaxedActivityType" }, "athlete_pr_effort": { "$ref": "#/definitions/AthletePrEffort" }, "athlete_segment_stats": { "$ref": "#/definitions/AthleteSegmentStats" }, "average_grade": { "title": "Average Grade", "type": "number" }, "city": { "title": "City", "type": "string" }, "climb_category": { "title": "Climb Category", "type": "integer" }, "country": { "title": "Country", "type": "string" }, "distance": { "title": "Distance", "type": "number" }, "elevation_high": { "title": "Elevation High", "type": "number" }, "elevation_low": { "title": "Elevation Low", "type": "number" }, "end_latlng": { "$ref": "#/definitions/LatLon" }, "id": { "title": "Id", "type": "integer" }, "maximum_grade": { "title": "Maximum Grade", "type": "number" }, "name": { "title": "Name", "type": "string" }, "private": { "title": "Private", "type": "boolean" }, "start_latlng": { "$ref": "#/definitions/LatLon" }, "state": { "title": "State", "type": "string" }, "athlete_count": { "title": "Athlete Count", "type": "integer" }, "created_at": { "title": "Created At", "type": "string", "format": "date-time" }, "effort_count": { "title": "Effort Count", "type": "integer" }, "hazardous": { "title": "Hazardous", "type": "boolean" }, "map": { "$ref": "#/definitions/Map" }, "star_count": { "title": "Star Count", "type": "integer" }, "total_elevation_gain": { "title": "Total Elevation Gain", "type": "number" }, "updated_at": { "title": "Updated At", "type": "string", "format": "date-time" }, "start_latitude": { "title": "Start Latitude", "type": "number" }, "end_latitude": { "title": "End Latitude", "type": "number" }, "start_longitude": { "title": "Start Longitude", "type": "number" }, "end_longitude": { "title": "End Longitude", "type": "number" }, "starred": { "title": "Starred", "type": "boolean" }, "pr_time": { "title": "Pr Time", "type": "number", "format": "time-delta" }, "starred_date": { "title": "Starred Date", "type": "string", "format": "date-time" }, "elevation_profile": { "title": "Elevation Profile", "type": "string" } } }, "SegmentEffortAchievement": { "title": "SegmentEffortAchievement", "description": "An undocumented structure being returned for segment efforts.\n\nNotes\n-----\nUndocumented Strava elements can change at any time without notice.", "type": "object", "properties": { "rank": { "title": "Rank", "type": "integer" }, "type": { "title": "Type", "type": "string" }, "type_id": { "title": "Type Id", "type": "integer" }, "effort_count": { "title": "Effort Count", "type": "integer" } } }, "SegmentEffort": { "title": "SegmentEffort", "description": "Class representing a best effort on a particular segment.", "type": "object", "properties": { "bound_client": { "title": "Bound Client" }, "activity_id": { "title": "Activity Id", "type": "integer" }, "distance": { "title": "Distance", "type": "number" }, "elapsed_time": { "title": "Elapsed Time", "type": "number", "format": "time-delta" }, "id": { "title": "Id", "type": "integer" }, "is_kom": { "title": "Is Kom", "type": "boolean" }, "start_date": { "title": "Start Date", "type": "string", "format": "date-time" }, "start_date_local": { "title": "Start Date Local", "type": "string", "format": "date-time" }, "activity": { "$ref": "#/definitions/Activity" }, "athlete": { "$ref": "#/definitions/Athlete" }, "average_cadence": { "title": "Average Cadence", "type": "number" }, "average_heartrate": { "title": "Average Heartrate", "type": "number" }, "average_watts": { "title": "Average Watts", "type": "number" }, "device_watts": { "title": "Device Watts", "type": "boolean" }, "end_index": { "title": "End Index", "type": "integer" }, "hidden": { "title": "Hidden", "type": "boolean" }, "kom_rank": { "title": "Kom Rank", "minimum": 1, "maximum": 10, "type": "integer" }, "max_heartrate": { "title": "Max Heartrate", "type": "number" }, "moving_time": { "title": "Moving Time", "type": "number", "format": "time-delta" }, "name": { "title": "Name", "type": "string" }, "pr_rank": { "title": "Pr Rank", "minimum": 1, "maximum": 3, "type": "integer" }, "segment": { "$ref": "#/definitions/Segment" }, "start_index": { "title": "Start Index", "type": "integer" }, "achievements": { "title": "Achievements", "type": "array", "items": { "$ref": "#/definitions/SegmentEffortAchievement" } } } }, "Split": { "title": "Split", "description": "A split -- may be metric or standard units (which has no bearing\non the units used in this object, just the binning of values).", "type": "object", "properties": { "average_speed": { "title": "Average Speed", "type": "number" }, "distance": { "title": "Distance", "type": "number" }, "elapsed_time": { "title": "Elapsed Time", "type": "number", "format": "time-delta" }, "elevation_difference": { "title": "Elevation Difference", "type": "number" }, "moving_time": { "title": "Moving Time", "type": "number", "format": "time-delta" }, "pace_zone": { "title": "Pace Zone", "type": "integer" }, "split": { "title": "Split", "type": "integer" }, "average_heartrate": { "title": "Average Heartrate", "type": "number" }, "average_grade_adjusted_speed": { "title": "Average Grade Adjusted Speed", "type": "number" } } }, "Activity": { "title": "Activity", "description": "Represents an activity (ride, run, etc.).", "type": "object", "properties": { "bound_client": { "title": "Bound Client" }, "id": { "title": "Id", "type": "integer" }, "achievement_count": { "title": "Achievement Count", "type": "integer" }, "athlete": { "$ref": "#/definitions/Athlete" }, "athlete_count": { "title": "Athlete Count", "minimum": 1, "type": "integer" }, "average_speed": { "title": "Average Speed", "type": "number" }, "average_watts": { "title": "Average Watts", "type": "number" }, "comment_count": { "title": "Comment Count", "type": "integer" }, "commute": { "title": "Commute", "type": "boolean" }, "device_watts": { "title": "Device Watts", "type": "boolean" }, "distance": { "title": "Distance", "type": "number" }, "elapsed_time": { "title": "Elapsed Time", "type": "number", "format": "time-delta" }, "elev_high": { "title": "Elev High", "type": "number" }, "elev_low": { "title": "Elev Low", "type": "number" }, "end_latlng": { "$ref": "#/definitions/LatLon" }, "external_id": { "title": "External Id", "type": "string" }, "flagged": { "title": "Flagged", "type": "boolean" }, "gear_id": { "title": "Gear Id", "type": "string" }, "has_kudoed": { "title": "Has Kudoed", "type": "boolean" }, "hide_from_home": { "title": "Hide From Home", "type": "boolean" }, "kilojoules": { "title": "Kilojoules", "type": "number" }, "kudos_count": { "title": "Kudos Count", "type": "integer" }, "manual": { "title": "Manual", "type": "boolean" }, "map": { "$ref": "#/definitions/Map" }, "max_speed": { "title": "Max Speed", "type": "number" }, "max_watts": { "title": "Max Watts", "type": "integer" }, "moving_time": { "title": "Moving Time", "type": "number", "format": "time-delta" }, "name": { "title": "Name", "type": "string" }, "photo_count": { "title": "Photo Count", "type": "integer" }, "private": { "title": "Private", "type": "boolean" }, "sport_type": { "$ref": "#/definitions/RelaxedSportType" }, "start_date": { "title": "Start Date", "type": "string", "format": "date-time" }, "start_date_local": { "title": "Start Date Local", "type": "string", "format": "date-time" }, "start_latlng": { "$ref": "#/definitions/LatLon" }, "timezone": { "title": "Timezone", "type": "string" }, "total_elevation_gain": { "title": "Total Elevation Gain", "type": "number" }, "total_photo_count": { "title": "Total Photo Count", "type": "integer" }, "trainer": { "title": "Trainer", "type": "boolean" }, "type": { "$ref": "#/definitions/RelaxedActivityType" }, "upload_id": { "title": "Upload Id", "type": "integer" }, "upload_id_str": { "title": "Upload Id Str", "type": "string" }, "weighted_average_watts": { "title": "Weighted Average Watts", "type": "integer" }, "workout_type": { "title": "Workout Type", "type": "integer" }, "best_efforts": { "title": "Best Efforts", "type": "array", "items": { "$ref": "#/definitions/BestEffort" } }, "calories": { "title": "Calories", "type": "number" }, "description": { "title": "Description", "type": "string" }, "device_name": { "title": "Device Name", "type": "string" }, "embed_token": { "title": "Embed Token", "type": "string" }, "gear": { "$ref": "#/definitions/Gear" }, "laps": { "title": "Laps", "type": "array", "items": { "$ref": "#/definitions/Lap" } }, "photos": { "$ref": "#/definitions/ActivityPhotoMeta" }, "segment_efforts": { "title": "Segment Efforts", "type": "array", "items": { "$ref": "#/definitions/SegmentEffort" } }, "splits_metric": { "title": "Splits Metric", "type": "array", "items": { "$ref": "#/definitions/Split" } }, "splits_standard": { "title": "Splits Standard", "type": "array", "items": { "$ref": "#/definitions/Split" } }, "guid": { "title": "Guid", "type": "string" }, "utc_offset": { "title": "Utc Offset", "type": "number" }, "location_city": { "title": "Location City", "type": "string" }, "location_state": { "title": "Location State", "type": "string" }, "location_country": { "title": "Location Country", "type": "string" }, "start_latitude": { "title": "Start Latitude", "type": "number" }, "start_longitude": { "title": "Start Longitude", "type": "number" }, "pr_count": { "title": "Pr Count", "type": "integer" }, "suffer_score": { "title": "Suffer Score", "type": "integer" }, "has_heartrate": { "title": "Has Heartrate", "type": "boolean" }, "average_heartrate": { "title": "Average Heartrate", "type": "number" }, "max_heartrate": { "title": "Max Heartrate", "type": "integer" }, "average_cadence": { "title": "Average Cadence", "type": "number" }, "average_temp": { "title": "Average Temp", "type": "integer" }, "instagram_primary_photo": { "title": "Instagram Primary Photo", "type": "string" }, "partner_logo_url": { "title": "Partner Logo Url", "type": "string" }, "partner_brand_tag": { "title": "Partner Brand Tag", "type": "string" }, "from_accepted_tag": { "title": "From Accepted Tag", "type": "boolean" }, "segment_leaderboard_opt_out": { "title": "Segment Leaderboard Opt Out", "type": "boolean" }, "perceived_exertion": { "title": "Perceived Exertion", "type": "integer" } } }, "BestEffort": { "title": "BestEffort", "description": "Class representing a best effort (e.g. best time for 5k)", "type": "object", "properties": { "bound_client": { "title": "Bound Client" }, "activity_id": { "title": "Activity Id", "type": "integer" }, "distance": { "title": "Distance", "type": "number" }, "elapsed_time": { "title": "Elapsed Time", "type": "number", "format": "time-delta" }, "id": { "title": "Id", "type": "integer" }, "is_kom": { "title": "Is Kom", "type": "boolean" }, "start_date": { "title": "Start Date", "type": "string", "format": "date-time" }, "start_date_local": { "title": "Start Date Local", "type": "string", "format": "date-time" }, "activity": { "$ref": "#/definitions/Activity" }, "athlete": { "$ref": "#/definitions/Athlete" }, "average_cadence": { "title": "Average Cadence", "type": "number" }, "average_heartrate": { "title": "Average Heartrate", "type": "number" }, "average_watts": { "title": "Average Watts", "type": "number" }, "device_watts": { "title": "Device Watts", "type": "boolean" }, "end_index": { "title": "End Index", "type": "integer" }, "hidden": { "title": "Hidden", "type": "boolean" }, "kom_rank": { "title": "Kom Rank", "minimum": 1, "maximum": 10, "type": "integer" }, "max_heartrate": { "title": "Max Heartrate", "type": "number" }, "moving_time": { "title": "Moving Time", "type": "number", "format": "time-delta" }, "name": { "title": "Name", "type": "string" }, "pr_rank": { "title": "Pr Rank", "minimum": 1, "maximum": 3, "type": "integer" }, "segment": { "$ref": "#/definitions/Segment" }, "start_index": { "title": "Start Index", "type": "integer" } } } } }
- Fields:
- Validators:
- field activity_id: int | None = None#
The unique identifier of the activity related to this effort
- field average_cadence: float | None = None#
The effortโs average cadence
- field average_heartrate: float | None = None#
The heart heart rate of the athlete during this effort
- field average_watts: float | None = None#
The average wattage of this effort
- field bound_client: Any | None = None#
- field device_watts: bool | None = None#
For riding efforts, whether the wattage was reported by a dedicated recording device
- field distance: float | None = None#
The effortโs distance in meters
- field elapsed_time: timedelta | None = None#
The effortโs elapsed time
- field end_index: int | None = None#
The end index of this effort in its activityโs stream
Whether this effort should be hidden when viewed within an activity
- field id: int | None = None#
The unique identifier of this effort
- field is_kom: bool | None = None#
Whether this effort is the current best on the leaderboard
- field kom_rank: int | None = None#
The rank of the effort on the global leaderboard if it belongs in the top 10 at the time of upload
- Constraints:
minimum = 1
maximum = 10
- field max_heartrate: float | None = None#
The maximum heart rate of the athlete during this effort
- field moving_time: timedelta | None = None#
The effortโs moving time
- field name: str | None = None#
The name of the segment on which this effort was performed
- field pr_rank: int | None = None#
The rank of the effort on the athleteโs leaderboard if it belongs in the top 3 at the time of upload
- Constraints:
minimum = 1
maximum = 3
- field start_date: datetime | None = None#
The time at which the effort was started.
- field start_date_local: datetime | None = None#
The time at which the effort was started in the local timezone.
- Validated by:
- field start_index: int | None = None#
The start index of this effort in its activityโs stream
- classmethod deserialize(attribute_value_mapping: dict[str, Any]) Self #
Creates and returns a new object based on serialized (dict) struct.
- Parameters:
attribute_value_mapping (dict) โ A dictionary representing the serialized data.
- Returns:
DeprecatedSerializableMixin โ A new instance of the class created from the serialized data.
Deprecated
โโโ-
1.0.0 โ The deserialize() method is deprecated in favor of parse_obj() method. For more details, refer to the Pydantic documentation: https://docs.pydantic.dev/usage/models/#helper-functions
- from_dict(attribute_value_mapping: dict[str, Any]) None #
Deserializes a dict into self, resetting and/or overwriting existing fields.
- Parameters:
attribute_value_mapping (dict) โ A dictionary that will be deserialized into the parent object.
Deprecated
----------
1.0.0 โ The from_dict() method is deprecated in favor of parse_obj() method. For more details, refer to the Pydantic documentation: https://docs.pydantic.dev/usage/models/#helper-functions
- to_dict() dict[str, Any] #
Returns a dict representation of self
- Returns:
dict โ A dictionary containing the data from the instance.
Deprecated
โโโ- โ The to_dict() method is deprecated in favor of dict() method. For more details, refer to the Pydantic documentation: https://docs.pydantic.dev/1.10/usage/exporting_models/
- pydantic model stravalib.model.SegmentEffort[source]#
Class representing a best effort on a particular segment.
Show JSON schema
{ "$ref": "#/definitions/SegmentEffort", "definitions": { "SummaryGear": { "title": "SummaryGear", "type": "object", "properties": { "distance": { "title": "Distance", "type": "number" }, "id": { "title": "Id", "type": "string" }, "name": { "title": "Name", "type": "string" }, "primary": { "title": "Primary", "type": "boolean" }, "resource_state": { "title": "Resource State", "type": "integer" } } }, "ActivityType": { "title": "ActivityType", "enum": [ "AlpineSki", "BackcountrySki", "Canoeing", "Crossfit", "EBikeRide", "Elliptical", "Golf", "Handcycle", "Hike", "IceSkate", "InlineSkate", "Kayaking", "Kitesurf", "NordicSki", "Ride", "RockClimbing", "RollerSki", "Rowing", "Run", "Sail", "Skateboard", "Snowboard", "Snowshoe", "Soccer", "StairStepper", "StandUpPaddling", "Surfing", "Swim", "Velomobile", "VirtualRide", "VirtualRun", "Walk", "WeightTraining", "Wheelchair", "Windsurf", "Workout", "Yoga" ], "type": "string" }, "SummaryClub": { "title": "SummaryClub", "type": "object", "properties": { "id": { "title": "Id", "type": "integer" }, "name": { "title": "Name", "type": "string" }, "resource_state": { "title": "Resource State", "type": "integer" }, "activity_types": { "title": "Activity Types", "type": "array", "items": { "$ref": "#/definitions/ActivityType" } }, "city": { "title": "City", "type": "string" }, "country": { "title": "Country", "type": "string" }, "cover_photo": { "title": "Cover Photo", "type": "string" }, "cover_photo_small": { "title": "Cover Photo Small", "type": "string" }, "featured": { "title": "Featured", "type": "boolean" }, "member_count": { "title": "Member Count", "type": "integer" }, "private": { "title": "Private", "type": "boolean" }, "profile_medium": { "title": "Profile Medium", "type": "string" }, "sport_type": { "title": "Sport Type", "enum": [ "cycling", "running", "triathlon", "other" ], "type": "string" }, "state": { "title": "State", "type": "string" }, "url": { "title": "Url", "type": "string" }, "verified": { "title": "Verified", "type": "boolean" } } }, "Athlete": { "title": "Athlete", "description": "Represents high level athlete information including\ntheir name, email, clubs they belong to, bikes, shoes, etc.\n\nNotes\n------\nAlso provides access to detailed athlete stats upon request.\nMany attributes in this object are undocumented by Strava and could be\nmodified at any time.", "type": "object", "properties": { "bound_client": { "title": "Bound Client" }, "id": { "title": "Id", "type": "integer" }, "city": { "title": "City", "type": "string" }, "country": { "title": "Country", "type": "string" }, "created_at": { "title": "Created At", "type": "string", "format": "date-time" }, "firstname": { "title": "Firstname", "type": "string" }, "lastname": { "title": "Lastname", "type": "string" }, "premium": { "title": "Premium", "type": "boolean" }, "profile": { "title": "Profile", "type": "string" }, "profile_medium": { "title": "Profile Medium", "type": "string" }, "resource_state": { "title": "Resource State", "type": "integer" }, "sex": { "title": "Sex", "enum": [ "M", "F" ], "type": "string" }, "state": { "title": "State", "type": "string" }, "summit": { "title": "Summit", "type": "boolean" }, "updated_at": { "title": "Updated At", "type": "string", "format": "date-time" }, "bikes": { "title": "Bikes", "type": "array", "items": { "$ref": "#/definitions/SummaryGear" } }, "clubs": { "title": "Clubs", "type": "array", "items": { "$ref": "#/definitions/SummaryClub" } }, "follower_count": { "title": "Follower Count", "type": "integer" }, "friend_count": { "title": "Friend Count", "type": "integer" }, "ftp": { "title": "Ftp", "type": "integer" }, "measurement_preference": { "title": "Measurement Preference", "enum": [ "feet", "meters" ], "type": "string" }, "shoes": { "title": "Shoes", "type": "array", "items": { "$ref": "#/definitions/SummaryGear" } }, "weight": { "title": "Weight", "type": "number" }, "is_authenticated": { "title": "Is Authenticated", "type": "boolean" }, "athlete_type": { "title": "Athlete Type", "enum": [ "cyclist", "runner" ], "type": "string" }, "friend": { "title": "Friend", "type": "string" }, "follower": { "title": "Follower", "type": "string" }, "approve_followers": { "title": "Approve Followers", "type": "boolean" }, "badge_type_id": { "title": "Badge Type Id", "type": "integer" }, "mutual_friend_count": { "title": "Mutual Friend Count", "type": "integer" }, "date_preference": { "title": "Date Preference", "type": "string" }, "email": { "title": "Email", "type": "string" }, "super_user": { "title": "Super User", "type": "boolean" }, "email_language": { "title": "Email Language", "type": "string" }, "max_heartrate": { "title": "Max Heartrate", "type": "number" }, "username": { "title": "Username", "type": "string" }, "description": { "title": "Description", "type": "string" }, "instagram_username": { "title": "Instagram Username", "type": "string" }, "offer_in_app_payment": { "title": "Offer In App Payment", "type": "boolean" }, "global_privacy": { "title": "Global Privacy", "type": "boolean" }, "receive_newsletter": { "title": "Receive Newsletter", "type": "boolean" }, "email_kom_lost": { "title": "Email Kom Lost", "type": "boolean" }, "dateofbirth": { "title": "Dateofbirth", "type": "string", "format": "date" }, "facebook_sharing_enabled": { "title": "Facebook Sharing Enabled", "type": "boolean" }, "profile_original": { "title": "Profile Original", "type": "string" }, "premium_expiration_date": { "title": "Premium Expiration Date", "type": "integer" }, "email_send_follower_notices": { "title": "Email Send Follower Notices", "type": "boolean" }, "plan": { "title": "Plan", "type": "string" }, "agreed_to_terms": { "title": "Agreed To Terms", "type": "string" }, "follower_request_count": { "title": "Follower Request Count", "type": "integer" }, "email_facebook_twitter_friend_joins": { "title": "Email Facebook Twitter Friend Joins", "type": "boolean" }, "receive_kudos_emails": { "title": "Receive Kudos Emails", "type": "boolean" }, "receive_follower_feed_emails": { "title": "Receive Follower Feed Emails", "type": "boolean" }, "receive_comment_emails": { "title": "Receive Comment Emails", "type": "boolean" }, "sample_race_distance": { "title": "Sample Race Distance", "type": "integer" }, "sample_race_time": { "title": "Sample Race Time", "type": "integer" }, "membership": { "title": "Membership", "type": "string" }, "admin": { "title": "Admin", "type": "boolean" }, "owner": { "title": "Owner", "type": "boolean" }, "subscription_permissions": { "title": "Subscription Permissions", "type": "array", "items": { "type": "boolean" } } } }, "LatLon": { "title": "LatLon", "description": "Enables backward compatibility for legacy namedtuple", "minItems": 2, "maxItems": 2, "type": "array", "items": { "type": "number" } }, "Map": { "title": "Map", "description": "Pass through object. Inherits from PolyLineMap", "type": "object", "properties": { "id": { "title": "Id", "type": "string" }, "polyline": { "title": "Polyline", "type": "string" }, "summary_polyline": { "title": "Summary Polyline", "type": "string" } } }, "RelaxedSportType": { "title": "RelaxedSportType", "enum": [ "AlpineSki", "BackcountrySki", "Badminton", "Canoeing", "Crossfit", "EBikeRide", "Elliptical", "EMountainBikeRide", "Golf", "GravelRide", "Handcycle", "HighIntensityIntervalTraining", "Hike", "IceSkate", "InlineSkate", "Kayaking", "Kitesurf", "MountainBikeRide", "NordicSki", "Pickleball", "Pilates", "Racquetball", "Ride", "RockClimbing", "RollerSki", "Rowing", "Run", "Sail", "Skateboard", "Snowboard", "Snowshoe", "Soccer", "Squash", "StairStepper", "StandUpPaddling", "Surfing", "Swim", "TableTennis", "Tennis", "TrailRun", "Velomobile", "VirtualRide", "VirtualRow", "VirtualRun", "Walk", "WeightTraining", "Wheelchair", "Windsurf", "Workout", "Yoga" ], "type": "string" }, "RelaxedActivityType": { "title": "RelaxedActivityType", "enum": [ "AlpineSki", "BackcountrySki", "Canoeing", "Crossfit", "EBikeRide", "Elliptical", "Golf", "Handcycle", "Hike", "IceSkate", "InlineSkate", "Kayaking", "Kitesurf", "NordicSki", "Ride", "RockClimbing", "RollerSki", "Rowing", "Run", "Sail", "Skateboard", "Snowboard", "Snowshoe", "Soccer", "StairStepper", "StandUpPaddling", "Surfing", "Swim", "Velomobile", "VirtualRide", "VirtualRun", "Walk", "WeightTraining", "Wheelchair", "Windsurf", "Workout", "Yoga" ], "type": "string" }, "AthletePrEffort": { "title": "AthletePrEffort", "description": "Mixin that intercepts attribute lookup and raises warnings or modifies\nreturn values based on what is defined in the following class attributes:\n\n* _field_conversions\n\nNotes\n------\nThe class attributes below are not yet implemented:\n* _deprecated_fields (TODO)\n* _unsupported_fields (TODO)", "type": "object", "properties": { "effort_count": { "title": "Effort Count", "type": "integer" }, "pr_activity_id": { "title": "Pr Activity Id", "type": "integer" }, "pr_date": { "title": "Pr Date", "type": "string", "format": "date-time" }, "pr_elapsed_time": { "title": "Pr Elapsed Time", "type": "number", "format": "time-delta" }, "distance": { "title": "Distance", "type": "number" }, "start_date": { "title": "Start Date", "type": "string", "format": "date-time" }, "start_date_local": { "title": "Start Date Local", "type": "string", "format": "date-time" }, "is_kom": { "title": "Is Kom", "type": "boolean" } } }, "AthleteSegmentStats": { "title": "AthleteSegmentStats", "description": "A structure being returned for segment stats for current athlete.", "type": "object", "properties": { "activity_id": { "title": "Activity Id", "type": "integer" }, "distance": { "title": "Distance", "type": "number" }, "elapsed_time": { "title": "Elapsed Time", "type": "number", "format": "time-delta" }, "id": { "title": "Id", "type": "integer" }, "is_kom": { "title": "Is Kom", "type": "boolean" }, "start_date": { "title": "Start Date", "type": "string", "format": "date-time" }, "start_date_local": { "title": "Start Date Local", "type": "string", "format": "date-time" }, "effort_count": { "title": "Effort Count", "type": "integer" }, "pr_elapsed_time": { "title": "Pr Elapsed Time", "type": "number", "format": "time-delta" }, "pr_date": { "title": "Pr Date", "type": "string", "format": "date" } } }, "Segment": { "title": "Segment", "description": "Represents a single Strava segment.", "type": "object", "properties": { "bound_client": { "title": "Bound Client" }, "activity_type": { "$ref": "#/definitions/RelaxedActivityType" }, "athlete_pr_effort": { "$ref": "#/definitions/AthletePrEffort" }, "athlete_segment_stats": { "$ref": "#/definitions/AthleteSegmentStats" }, "average_grade": { "title": "Average Grade", "type": "number" }, "city": { "title": "City", "type": "string" }, "climb_category": { "title": "Climb Category", "type": "integer" }, "country": { "title": "Country", "type": "string" }, "distance": { "title": "Distance", "type": "number" }, "elevation_high": { "title": "Elevation High", "type": "number" }, "elevation_low": { "title": "Elevation Low", "type": "number" }, "end_latlng": { "$ref": "#/definitions/LatLon" }, "id": { "title": "Id", "type": "integer" }, "maximum_grade": { "title": "Maximum Grade", "type": "number" }, "name": { "title": "Name", "type": "string" }, "private": { "title": "Private", "type": "boolean" }, "start_latlng": { "$ref": "#/definitions/LatLon" }, "state": { "title": "State", "type": "string" }, "athlete_count": { "title": "Athlete Count", "type": "integer" }, "created_at": { "title": "Created At", "type": "string", "format": "date-time" }, "effort_count": { "title": "Effort Count", "type": "integer" }, "hazardous": { "title": "Hazardous", "type": "boolean" }, "map": { "$ref": "#/definitions/Map" }, "star_count": { "title": "Star Count", "type": "integer" }, "total_elevation_gain": { "title": "Total Elevation Gain", "type": "number" }, "updated_at": { "title": "Updated At", "type": "string", "format": "date-time" }, "start_latitude": { "title": "Start Latitude", "type": "number" }, "end_latitude": { "title": "End Latitude", "type": "number" }, "start_longitude": { "title": "Start Longitude", "type": "number" }, "end_longitude": { "title": "End Longitude", "type": "number" }, "starred": { "title": "Starred", "type": "boolean" }, "pr_time": { "title": "Pr Time", "type": "number", "format": "time-delta" }, "starred_date": { "title": "Starred Date", "type": "string", "format": "date-time" }, "elevation_profile": { "title": "Elevation Profile", "type": "string" } } }, "BestEffort": { "title": "BestEffort", "description": "Class representing a best effort (e.g. best time for 5k)", "type": "object", "properties": { "bound_client": { "title": "Bound Client" }, "activity_id": { "title": "Activity Id", "type": "integer" }, "distance": { "title": "Distance", "type": "number" }, "elapsed_time": { "title": "Elapsed Time", "type": "number", "format": "time-delta" }, "id": { "title": "Id", "type": "integer" }, "is_kom": { "title": "Is Kom", "type": "boolean" }, "start_date": { "title": "Start Date", "type": "string", "format": "date-time" }, "start_date_local": { "title": "Start Date Local", "type": "string", "format": "date-time" }, "activity": { "$ref": "#/definitions/Activity" }, "athlete": { "$ref": "#/definitions/Athlete" }, "average_cadence": { "title": "Average Cadence", "type": "number" }, "average_heartrate": { "title": "Average Heartrate", "type": "number" }, "average_watts": { "title": "Average Watts", "type": "number" }, "device_watts": { "title": "Device Watts", "type": "boolean" }, "end_index": { "title": "End Index", "type": "integer" }, "hidden": { "title": "Hidden", "type": "boolean" }, "kom_rank": { "title": "Kom Rank", "minimum": 1, "maximum": 10, "type": "integer" }, "max_heartrate": { "title": "Max Heartrate", "type": "number" }, "moving_time": { "title": "Moving Time", "type": "number", "format": "time-delta" }, "name": { "title": "Name", "type": "string" }, "pr_rank": { "title": "Pr Rank", "minimum": 1, "maximum": 3, "type": "integer" }, "segment": { "$ref": "#/definitions/Segment" }, "start_index": { "title": "Start Index", "type": "integer" } } }, "Gear": { "title": "Gear", "description": "Represents a piece of gear (equipment) used in physical activities.", "type": "object", "properties": { "distance": { "title": "Distance", "type": "number" }, "id": { "title": "Id", "type": "string" }, "name": { "title": "Name", "type": "string" }, "primary": { "title": "Primary", "type": "boolean" }, "resource_state": { "title": "Resource State", "type": "integer" }, "brand_name": { "title": "Brand Name", "type": "string" }, "description": { "title": "Description", "type": "string" }, "frame_type": { "title": "Frame Type", "type": "integer" }, "model_name": { "title": "Model Name", "type": "string" } } }, "MetaActivity": { "title": "MetaActivity", "type": "object", "properties": { "id": { "title": "Id", "type": "integer" } } }, "MetaAthlete": { "title": "MetaAthlete", "type": "object", "properties": { "id": { "title": "Id", "type": "integer" } } }, "Lap": { "title": "Lap", "type": "object", "properties": { "activity": { "$ref": "#/definitions/MetaActivity" }, "athlete": { "$ref": "#/definitions/MetaAthlete" }, "average_cadence": { "title": "Average Cadence", "type": "number" }, "average_speed": { "title": "Average Speed", "type": "number" }, "distance": { "title": "Distance", "type": "number" }, "elapsed_time": { "title": "Elapsed Time", "type": "integer" }, "end_index": { "title": "End Index", "type": "integer" }, "id": { "title": "Id", "type": "integer" }, "lap_index": { "title": "Lap Index", "type": "integer" }, "max_speed": { "title": "Max Speed", "type": "number" }, "moving_time": { "title": "Moving Time", "type": "integer" }, "name": { "title": "Name", "type": "string" }, "pace_zone": { "title": "Pace Zone", "type": "integer" }, "split": { "title": "Split", "type": "integer" }, "start_date": { "title": "Start Date", "type": "string", "format": "date-time" }, "start_date_local": { "title": "Start Date Local", "type": "string", "format": "date-time" }, "start_index": { "title": "Start Index", "type": "integer" }, "total_elevation_gain": { "title": "Total Elevation Gain", "type": "number" } } }, "ActivityPhotoPrimary": { "title": "ActivityPhotoPrimary", "description": "Represents the primary photo for an activity.\n\nAttributes\n----------\nuse_primary_photo : bool, optional\n Indicates whether the photo is used as the primary photo.\n\nNotes\n-----\nAttributes for activity photos are currently undocumented.", "type": "object", "properties": { "id": { "title": "Id", "type": "integer" }, "source": { "title": "Source", "type": "integer" }, "unique_id": { "title": "Unique Id", "type": "string" }, "urls": { "title": "Urls", "type": "object", "additionalProperties": { "type": "string" } }, "use_primary_photo": { "title": "Use Primary Photo", "type": "boolean" } } }, "ActivityPhotoMeta": { "title": "ActivityPhotoMeta", "description": "Represents the metadata of photos returned with the activity.\n\nNot to be confused with the fully loaded photos for an activity.\n\nAttributes\n----------\nprimary : ActivityPhotoPrimary, optional\n The primary photo for the activity.\nuse_primary_photo : bool, optional\n Indicates whether the primary photo is used. Not currently documented\n by Strava.\n\nNotes\n-----\nUndocumented attributes could be changed by Strava at any time.", "type": "object", "properties": { "count": { "title": "Count", "type": "integer" }, "primary": { "$ref": "#/definitions/ActivityPhotoPrimary" }, "use_primary_photo": { "title": "Use Primary Photo", "type": "boolean" } } }, "Split": { "title": "Split", "description": "A split -- may be metric or standard units (which has no bearing\non the units used in this object, just the binning of values).", "type": "object", "properties": { "average_speed": { "title": "Average Speed", "type": "number" }, "distance": { "title": "Distance", "type": "number" }, "elapsed_time": { "title": "Elapsed Time", "type": "number", "format": "time-delta" }, "elevation_difference": { "title": "Elevation Difference", "type": "number" }, "moving_time": { "title": "Moving Time", "type": "number", "format": "time-delta" }, "pace_zone": { "title": "Pace Zone", "type": "integer" }, "split": { "title": "Split", "type": "integer" }, "average_heartrate": { "title": "Average Heartrate", "type": "number" }, "average_grade_adjusted_speed": { "title": "Average Grade Adjusted Speed", "type": "number" } } }, "Activity": { "title": "Activity", "description": "Represents an activity (ride, run, etc.).", "type": "object", "properties": { "bound_client": { "title": "Bound Client" }, "id": { "title": "Id", "type": "integer" }, "achievement_count": { "title": "Achievement Count", "type": "integer" }, "athlete": { "$ref": "#/definitions/Athlete" }, "athlete_count": { "title": "Athlete Count", "minimum": 1, "type": "integer" }, "average_speed": { "title": "Average Speed", "type": "number" }, "average_watts": { "title": "Average Watts", "type": "number" }, "comment_count": { "title": "Comment Count", "type": "integer" }, "commute": { "title": "Commute", "type": "boolean" }, "device_watts": { "title": "Device Watts", "type": "boolean" }, "distance": { "title": "Distance", "type": "number" }, "elapsed_time": { "title": "Elapsed Time", "type": "number", "format": "time-delta" }, "elev_high": { "title": "Elev High", "type": "number" }, "elev_low": { "title": "Elev Low", "type": "number" }, "end_latlng": { "$ref": "#/definitions/LatLon" }, "external_id": { "title": "External Id", "type": "string" }, "flagged": { "title": "Flagged", "type": "boolean" }, "gear_id": { "title": "Gear Id", "type": "string" }, "has_kudoed": { "title": "Has Kudoed", "type": "boolean" }, "hide_from_home": { "title": "Hide From Home", "type": "boolean" }, "kilojoules": { "title": "Kilojoules", "type": "number" }, "kudos_count": { "title": "Kudos Count", "type": "integer" }, "manual": { "title": "Manual", "type": "boolean" }, "map": { "$ref": "#/definitions/Map" }, "max_speed": { "title": "Max Speed", "type": "number" }, "max_watts": { "title": "Max Watts", "type": "integer" }, "moving_time": { "title": "Moving Time", "type": "number", "format": "time-delta" }, "name": { "title": "Name", "type": "string" }, "photo_count": { "title": "Photo Count", "type": "integer" }, "private": { "title": "Private", "type": "boolean" }, "sport_type": { "$ref": "#/definitions/RelaxedSportType" }, "start_date": { "title": "Start Date", "type": "string", "format": "date-time" }, "start_date_local": { "title": "Start Date Local", "type": "string", "format": "date-time" }, "start_latlng": { "$ref": "#/definitions/LatLon" }, "timezone": { "title": "Timezone", "type": "string" }, "total_elevation_gain": { "title": "Total Elevation Gain", "type": "number" }, "total_photo_count": { "title": "Total Photo Count", "type": "integer" }, "trainer": { "title": "Trainer", "type": "boolean" }, "type": { "$ref": "#/definitions/RelaxedActivityType" }, "upload_id": { "title": "Upload Id", "type": "integer" }, "upload_id_str": { "title": "Upload Id Str", "type": "string" }, "weighted_average_watts": { "title": "Weighted Average Watts", "type": "integer" }, "workout_type": { "title": "Workout Type", "type": "integer" }, "best_efforts": { "title": "Best Efforts", "type": "array", "items": { "$ref": "#/definitions/BestEffort" } }, "calories": { "title": "Calories", "type": "number" }, "description": { "title": "Description", "type": "string" }, "device_name": { "title": "Device Name", "type": "string" }, "embed_token": { "title": "Embed Token", "type": "string" }, "gear": { "$ref": "#/definitions/Gear" }, "laps": { "title": "Laps", "type": "array", "items": { "$ref": "#/definitions/Lap" } }, "photos": { "$ref": "#/definitions/ActivityPhotoMeta" }, "segment_efforts": { "title": "Segment Efforts", "type": "array", "items": { "$ref": "#/definitions/SegmentEffort" } }, "splits_metric": { "title": "Splits Metric", "type": "array", "items": { "$ref": "#/definitions/Split" } }, "splits_standard": { "title": "Splits Standard", "type": "array", "items": { "$ref": "#/definitions/Split" } }, "guid": { "title": "Guid", "type": "string" }, "utc_offset": { "title": "Utc Offset", "type": "number" }, "location_city": { "title": "Location City", "type": "string" }, "location_state": { "title": "Location State", "type": "string" }, "location_country": { "title": "Location Country", "type": "string" }, "start_latitude": { "title": "Start Latitude", "type": "number" }, "start_longitude": { "title": "Start Longitude", "type": "number" }, "pr_count": { "title": "Pr Count", "type": "integer" }, "suffer_score": { "title": "Suffer Score", "type": "integer" }, "has_heartrate": { "title": "Has Heartrate", "type": "boolean" }, "average_heartrate": { "title": "Average Heartrate", "type": "number" }, "max_heartrate": { "title": "Max Heartrate", "type": "integer" }, "average_cadence": { "title": "Average Cadence", "type": "number" }, "average_temp": { "title": "Average Temp", "type": "integer" }, "instagram_primary_photo": { "title": "Instagram Primary Photo", "type": "string" }, "partner_logo_url": { "title": "Partner Logo Url", "type": "string" }, "partner_brand_tag": { "title": "Partner Brand Tag", "type": "string" }, "from_accepted_tag": { "title": "From Accepted Tag", "type": "boolean" }, "segment_leaderboard_opt_out": { "title": "Segment Leaderboard Opt Out", "type": "boolean" }, "perceived_exertion": { "title": "Perceived Exertion", "type": "integer" } } }, "SegmentEffortAchievement": { "title": "SegmentEffortAchievement", "description": "An undocumented structure being returned for segment efforts.\n\nNotes\n-----\nUndocumented Strava elements can change at any time without notice.", "type": "object", "properties": { "rank": { "title": "Rank", "type": "integer" }, "type": { "title": "Type", "type": "string" }, "type_id": { "title": "Type Id", "type": "integer" }, "effort_count": { "title": "Effort Count", "type": "integer" } } }, "SegmentEffort": { "title": "SegmentEffort", "description": "Class representing a best effort on a particular segment.", "type": "object", "properties": { "bound_client": { "title": "Bound Client" }, "activity_id": { "title": "Activity Id", "type": "integer" }, "distance": { "title": "Distance", "type": "number" }, "elapsed_time": { "title": "Elapsed Time", "type": "number", "format": "time-delta" }, "id": { "title": "Id", "type": "integer" }, "is_kom": { "title": "Is Kom", "type": "boolean" }, "start_date": { "title": "Start Date", "type": "string", "format": "date-time" }, "start_date_local": { "title": "Start Date Local", "type": "string", "format": "date-time" }, "activity": { "$ref": "#/definitions/Activity" }, "athlete": { "$ref": "#/definitions/Athlete" }, "average_cadence": { "title": "Average Cadence", "type": "number" }, "average_heartrate": { "title": "Average Heartrate", "type": "number" }, "average_watts": { "title": "Average Watts", "type": "number" }, "device_watts": { "title": "Device Watts", "type": "boolean" }, "end_index": { "title": "End Index", "type": "integer" }, "hidden": { "title": "Hidden", "type": "boolean" }, "kom_rank": { "title": "Kom Rank", "minimum": 1, "maximum": 10, "type": "integer" }, "max_heartrate": { "title": "Max Heartrate", "type": "number" }, "moving_time": { "title": "Moving Time", "type": "number", "format": "time-delta" }, "name": { "title": "Name", "type": "string" }, "pr_rank": { "title": "Pr Rank", "minimum": 1, "maximum": 3, "type": "integer" }, "segment": { "$ref": "#/definitions/Segment" }, "start_index": { "title": "Start Index", "type": "integer" }, "achievements": { "title": "Achievements", "type": "array", "items": { "$ref": "#/definitions/SegmentEffortAchievement" } } } } } }
- Fields:
- Validators:
- field achievements: list[SegmentEffortAchievement] | None = None#
- field activity_id: int | None = None#
The unique identifier of the activity related to this effort
- field average_cadence: float | None = None#
The effortโs average cadence
- field average_heartrate: float | None = None#
The heart heart rate of the athlete during this effort
- field average_watts: float | None = None#
The average wattage of this effort
- field bound_client: Any | None = None#
- field device_watts: bool | None = None#
For riding efforts, whether the wattage was reported by a dedicated recording device
- field distance: float | None = None#
The effortโs distance in meters
- field elapsed_time: timedelta | None = None#
The effortโs elapsed time
- field end_index: int | None = None#
The end index of this effort in its activityโs stream
Whether this effort should be hidden when viewed within an activity
- field id: int | None = None#
The unique identifier of this effort
- field is_kom: bool | None = None#
Whether this effort is the current best on the leaderboard
- field kom_rank: int | None = None#
The rank of the effort on the global leaderboard if it belongs in the top 10 at the time of upload
- Constraints:
minimum = 1
maximum = 10
- field max_heartrate: float | None = None#
The maximum heart rate of the athlete during this effort
- field moving_time: timedelta | None = None#
The effortโs moving time
- field name: str | None = None#
The name of the segment on which this effort was performed
- field pr_rank: int | None = None#
The rank of the effort on the athleteโs leaderboard if it belongs in the top 3 at the time of upload
- Constraints:
minimum = 1
maximum = 3
- field start_date: datetime | None = None#
The time at which the effort was started.
- field start_date_local: datetime | None = None#
The time at which the effort was started in the local timezone.
- Validated by:
- field start_index: int | None = None#
The start index of this effort in its activityโs stream
- classmethod deserialize(attribute_value_mapping: dict[str, Any]) Self #
Creates and returns a new object based on serialized (dict) struct.
- Parameters:
attribute_value_mapping (dict) โ A dictionary representing the serialized data.
- Returns:
DeprecatedSerializableMixin โ A new instance of the class created from the serialized data.
Deprecated
โโโ-
1.0.0 โ The deserialize() method is deprecated in favor of parse_obj() method. For more details, refer to the Pydantic documentation: https://docs.pydantic.dev/usage/models/#helper-functions
- from_dict(attribute_value_mapping: dict[str, Any]) None #
Deserializes a dict into self, resetting and/or overwriting existing fields.
- Parameters:
attribute_value_mapping (dict) โ A dictionary that will be deserialized into the parent object.
Deprecated
----------
1.0.0 โ The from_dict() method is deprecated in favor of parse_obj() method. For more details, refer to the Pydantic documentation: https://docs.pydantic.dev/usage/models/#helper-functions
- to_dict() dict[str, Any] #
Returns a dict representation of self
- Returns:
dict โ A dictionary containing the data from the instance.
Deprecated
โโโ- โ The to_dict() method is deprecated in favor of dict() method. For more details, refer to the Pydantic documentation: https://docs.pydantic.dev/1.10/usage/exporting_models/
- pydantic model stravalib.model.Activity[source]#
Represents an activity (ride, run, etc.).
Show JSON schema
{ "$ref": "#/definitions/Activity", "definitions": { "SummaryGear": { "title": "SummaryGear", "type": "object", "properties": { "distance": { "title": "Distance", "type": "number" }, "id": { "title": "Id", "type": "string" }, "name": { "title": "Name", "type": "string" }, "primary": { "title": "Primary", "type": "boolean" }, "resource_state": { "title": "Resource State", "type": "integer" } } }, "ActivityType": { "title": "ActivityType", "enum": [ "AlpineSki", "BackcountrySki", "Canoeing", "Crossfit", "EBikeRide", "Elliptical", "Golf", "Handcycle", "Hike", "IceSkate", "InlineSkate", "Kayaking", "Kitesurf", "NordicSki", "Ride", "RockClimbing", "RollerSki", "Rowing", "Run", "Sail", "Skateboard", "Snowboard", "Snowshoe", "Soccer", "StairStepper", "StandUpPaddling", "Surfing", "Swim", "Velomobile", "VirtualRide", "VirtualRun", "Walk", "WeightTraining", "Wheelchair", "Windsurf", "Workout", "Yoga" ], "type": "string" }, "SummaryClub": { "title": "SummaryClub", "type": "object", "properties": { "id": { "title": "Id", "type": "integer" }, "name": { "title": "Name", "type": "string" }, "resource_state": { "title": "Resource State", "type": "integer" }, "activity_types": { "title": "Activity Types", "type": "array", "items": { "$ref": "#/definitions/ActivityType" } }, "city": { "title": "City", "type": "string" }, "country": { "title": "Country", "type": "string" }, "cover_photo": { "title": "Cover Photo", "type": "string" }, "cover_photo_small": { "title": "Cover Photo Small", "type": "string" }, "featured": { "title": "Featured", "type": "boolean" }, "member_count": { "title": "Member Count", "type": "integer" }, "private": { "title": "Private", "type": "boolean" }, "profile_medium": { "title": "Profile Medium", "type": "string" }, "sport_type": { "title": "Sport Type", "enum": [ "cycling", "running", "triathlon", "other" ], "type": "string" }, "state": { "title": "State", "type": "string" }, "url": { "title": "Url", "type": "string" }, "verified": { "title": "Verified", "type": "boolean" } } }, "Athlete": { "title": "Athlete", "description": "Represents high level athlete information including\ntheir name, email, clubs they belong to, bikes, shoes, etc.\n\nNotes\n------\nAlso provides access to detailed athlete stats upon request.\nMany attributes in this object are undocumented by Strava and could be\nmodified at any time.", "type": "object", "properties": { "bound_client": { "title": "Bound Client" }, "id": { "title": "Id", "type": "integer" }, "city": { "title": "City", "type": "string" }, "country": { "title": "Country", "type": "string" }, "created_at": { "title": "Created At", "type": "string", "format": "date-time" }, "firstname": { "title": "Firstname", "type": "string" }, "lastname": { "title": "Lastname", "type": "string" }, "premium": { "title": "Premium", "type": "boolean" }, "profile": { "title": "Profile", "type": "string" }, "profile_medium": { "title": "Profile Medium", "type": "string" }, "resource_state": { "title": "Resource State", "type": "integer" }, "sex": { "title": "Sex", "enum": [ "M", "F" ], "type": "string" }, "state": { "title": "State", "type": "string" }, "summit": { "title": "Summit", "type": "boolean" }, "updated_at": { "title": "Updated At", "type": "string", "format": "date-time" }, "bikes": { "title": "Bikes", "type": "array", "items": { "$ref": "#/definitions/SummaryGear" } }, "clubs": { "title": "Clubs", "type": "array", "items": { "$ref": "#/definitions/SummaryClub" } }, "follower_count": { "title": "Follower Count", "type": "integer" }, "friend_count": { "title": "Friend Count", "type": "integer" }, "ftp": { "title": "Ftp", "type": "integer" }, "measurement_preference": { "title": "Measurement Preference", "enum": [ "feet", "meters" ], "type": "string" }, "shoes": { "title": "Shoes", "type": "array", "items": { "$ref": "#/definitions/SummaryGear" } }, "weight": { "title": "Weight", "type": "number" }, "is_authenticated": { "title": "Is Authenticated", "type": "boolean" }, "athlete_type": { "title": "Athlete Type", "enum": [ "cyclist", "runner" ], "type": "string" }, "friend": { "title": "Friend", "type": "string" }, "follower": { "title": "Follower", "type": "string" }, "approve_followers": { "title": "Approve Followers", "type": "boolean" }, "badge_type_id": { "title": "Badge Type Id", "type": "integer" }, "mutual_friend_count": { "title": "Mutual Friend Count", "type": "integer" }, "date_preference": { "title": "Date Preference", "type": "string" }, "email": { "title": "Email", "type": "string" }, "super_user": { "title": "Super User", "type": "boolean" }, "email_language": { "title": "Email Language", "type": "string" }, "max_heartrate": { "title": "Max Heartrate", "type": "number" }, "username": { "title": "Username", "type": "string" }, "description": { "title": "Description", "type": "string" }, "instagram_username": { "title": "Instagram Username", "type": "string" }, "offer_in_app_payment": { "title": "Offer In App Payment", "type": "boolean" }, "global_privacy": { "title": "Global Privacy", "type": "boolean" }, "receive_newsletter": { "title": "Receive Newsletter", "type": "boolean" }, "email_kom_lost": { "title": "Email Kom Lost", "type": "boolean" }, "dateofbirth": { "title": "Dateofbirth", "type": "string", "format": "date" }, "facebook_sharing_enabled": { "title": "Facebook Sharing Enabled", "type": "boolean" }, "profile_original": { "title": "Profile Original", "type": "string" }, "premium_expiration_date": { "title": "Premium Expiration Date", "type": "integer" }, "email_send_follower_notices": { "title": "Email Send Follower Notices", "type": "boolean" }, "plan": { "title": "Plan", "type": "string" }, "agreed_to_terms": { "title": "Agreed To Terms", "type": "string" }, "follower_request_count": { "title": "Follower Request Count", "type": "integer" }, "email_facebook_twitter_friend_joins": { "title": "Email Facebook Twitter Friend Joins", "type": "boolean" }, "receive_kudos_emails": { "title": "Receive Kudos Emails", "type": "boolean" }, "receive_follower_feed_emails": { "title": "Receive Follower Feed Emails", "type": "boolean" }, "receive_comment_emails": { "title": "Receive Comment Emails", "type": "boolean" }, "sample_race_distance": { "title": "Sample Race Distance", "type": "integer" }, "sample_race_time": { "title": "Sample Race Time", "type": "integer" }, "membership": { "title": "Membership", "type": "string" }, "admin": { "title": "Admin", "type": "boolean" }, "owner": { "title": "Owner", "type": "boolean" }, "subscription_permissions": { "title": "Subscription Permissions", "type": "array", "items": { "type": "boolean" } } } }, "LatLon": { "title": "LatLon", "description": "Enables backward compatibility for legacy namedtuple", "minItems": 2, "maxItems": 2, "type": "array", "items": { "type": "number" } }, "Map": { "title": "Map", "description": "Pass through object. Inherits from PolyLineMap", "type": "object", "properties": { "id": { "title": "Id", "type": "string" }, "polyline": { "title": "Polyline", "type": "string" }, "summary_polyline": { "title": "Summary Polyline", "type": "string" } } }, "RelaxedSportType": { "title": "RelaxedSportType", "enum": [ "AlpineSki", "BackcountrySki", "Badminton", "Canoeing", "Crossfit", "EBikeRide", "Elliptical", "EMountainBikeRide", "Golf", "GravelRide", "Handcycle", "HighIntensityIntervalTraining", "Hike", "IceSkate", "InlineSkate", "Kayaking", "Kitesurf", "MountainBikeRide", "NordicSki", "Pickleball", "Pilates", "Racquetball", "Ride", "RockClimbing", "RollerSki", "Rowing", "Run", "Sail", "Skateboard", "Snowboard", "Snowshoe", "Soccer", "Squash", "StairStepper", "StandUpPaddling", "Surfing", "Swim", "TableTennis", "Tennis", "TrailRun", "Velomobile", "VirtualRide", "VirtualRow", "VirtualRun", "Walk", "WeightTraining", "Wheelchair", "Windsurf", "Workout", "Yoga" ], "type": "string" }, "RelaxedActivityType": { "title": "RelaxedActivityType", "enum": [ "AlpineSki", "BackcountrySki", "Canoeing", "Crossfit", "EBikeRide", "Elliptical", "Golf", "Handcycle", "Hike", "IceSkate", "InlineSkate", "Kayaking", "Kitesurf", "NordicSki", "Ride", "RockClimbing", "RollerSki", "Rowing", "Run", "Sail", "Skateboard", "Snowboard", "Snowshoe", "Soccer", "StairStepper", "StandUpPaddling", "Surfing", "Swim", "Velomobile", "VirtualRide", "VirtualRun", "Walk", "WeightTraining", "Wheelchair", "Windsurf", "Workout", "Yoga" ], "type": "string" }, "AthletePrEffort": { "title": "AthletePrEffort", "description": "Mixin that intercepts attribute lookup and raises warnings or modifies\nreturn values based on what is defined in the following class attributes:\n\n* _field_conversions\n\nNotes\n------\nThe class attributes below are not yet implemented:\n* _deprecated_fields (TODO)\n* _unsupported_fields (TODO)", "type": "object", "properties": { "effort_count": { "title": "Effort Count", "type": "integer" }, "pr_activity_id": { "title": "Pr Activity Id", "type": "integer" }, "pr_date": { "title": "Pr Date", "type": "string", "format": "date-time" }, "pr_elapsed_time": { "title": "Pr Elapsed Time", "type": "number", "format": "time-delta" }, "distance": { "title": "Distance", "type": "number" }, "start_date": { "title": "Start Date", "type": "string", "format": "date-time" }, "start_date_local": { "title": "Start Date Local", "type": "string", "format": "date-time" }, "is_kom": { "title": "Is Kom", "type": "boolean" } } }, "AthleteSegmentStats": { "title": "AthleteSegmentStats", "description": "A structure being returned for segment stats for current athlete.", "type": "object", "properties": { "activity_id": { "title": "Activity Id", "type": "integer" }, "distance": { "title": "Distance", "type": "number" }, "elapsed_time": { "title": "Elapsed Time", "type": "number", "format": "time-delta" }, "id": { "title": "Id", "type": "integer" }, "is_kom": { "title": "Is Kom", "type": "boolean" }, "start_date": { "title": "Start Date", "type": "string", "format": "date-time" }, "start_date_local": { "title": "Start Date Local", "type": "string", "format": "date-time" }, "effort_count": { "title": "Effort Count", "type": "integer" }, "pr_elapsed_time": { "title": "Pr Elapsed Time", "type": "number", "format": "time-delta" }, "pr_date": { "title": "Pr Date", "type": "string", "format": "date" } } }, "Segment": { "title": "Segment", "description": "Represents a single Strava segment.", "type": "object", "properties": { "bound_client": { "title": "Bound Client" }, "activity_type": { "$ref": "#/definitions/RelaxedActivityType" }, "athlete_pr_effort": { "$ref": "#/definitions/AthletePrEffort" }, "athlete_segment_stats": { "$ref": "#/definitions/AthleteSegmentStats" }, "average_grade": { "title": "Average Grade", "type": "number" }, "city": { "title": "City", "type": "string" }, "climb_category": { "title": "Climb Category", "type": "integer" }, "country": { "title": "Country", "type": "string" }, "distance": { "title": "Distance", "type": "number" }, "elevation_high": { "title": "Elevation High", "type": "number" }, "elevation_low": { "title": "Elevation Low", "type": "number" }, "end_latlng": { "$ref": "#/definitions/LatLon" }, "id": { "title": "Id", "type": "integer" }, "maximum_grade": { "title": "Maximum Grade", "type": "number" }, "name": { "title": "Name", "type": "string" }, "private": { "title": "Private", "type": "boolean" }, "start_latlng": { "$ref": "#/definitions/LatLon" }, "state": { "title": "State", "type": "string" }, "athlete_count": { "title": "Athlete Count", "type": "integer" }, "created_at": { "title": "Created At", "type": "string", "format": "date-time" }, "effort_count": { "title": "Effort Count", "type": "integer" }, "hazardous": { "title": "Hazardous", "type": "boolean" }, "map": { "$ref": "#/definitions/Map" }, "star_count": { "title": "Star Count", "type": "integer" }, "total_elevation_gain": { "title": "Total Elevation Gain", "type": "number" }, "updated_at": { "title": "Updated At", "type": "string", "format": "date-time" }, "start_latitude": { "title": "Start Latitude", "type": "number" }, "end_latitude": { "title": "End Latitude", "type": "number" }, "start_longitude": { "title": "Start Longitude", "type": "number" }, "end_longitude": { "title": "End Longitude", "type": "number" }, "starred": { "title": "Starred", "type": "boolean" }, "pr_time": { "title": "Pr Time", "type": "number", "format": "time-delta" }, "starred_date": { "title": "Starred Date", "type": "string", "format": "date-time" }, "elevation_profile": { "title": "Elevation Profile", "type": "string" } } }, "BestEffort": { "title": "BestEffort", "description": "Class representing a best effort (e.g. best time for 5k)", "type": "object", "properties": { "bound_client": { "title": "Bound Client" }, "activity_id": { "title": "Activity Id", "type": "integer" }, "distance": { "title": "Distance", "type": "number" }, "elapsed_time": { "title": "Elapsed Time", "type": "number", "format": "time-delta" }, "id": { "title": "Id", "type": "integer" }, "is_kom": { "title": "Is Kom", "type": "boolean" }, "start_date": { "title": "Start Date", "type": "string", "format": "date-time" }, "start_date_local": { "title": "Start Date Local", "type": "string", "format": "date-time" }, "activity": { "$ref": "#/definitions/Activity" }, "athlete": { "$ref": "#/definitions/Athlete" }, "average_cadence": { "title": "Average Cadence", "type": "number" }, "average_heartrate": { "title": "Average Heartrate", "type": "number" }, "average_watts": { "title": "Average Watts", "type": "number" }, "device_watts": { "title": "Device Watts", "type": "boolean" }, "end_index": { "title": "End Index", "type": "integer" }, "hidden": { "title": "Hidden", "type": "boolean" }, "kom_rank": { "title": "Kom Rank", "minimum": 1, "maximum": 10, "type": "integer" }, "max_heartrate": { "title": "Max Heartrate", "type": "number" }, "moving_time": { "title": "Moving Time", "type": "number", "format": "time-delta" }, "name": { "title": "Name", "type": "string" }, "pr_rank": { "title": "Pr Rank", "minimum": 1, "maximum": 3, "type": "integer" }, "segment": { "$ref": "#/definitions/Segment" }, "start_index": { "title": "Start Index", "type": "integer" } } }, "Gear": { "title": "Gear", "description": "Represents a piece of gear (equipment) used in physical activities.", "type": "object", "properties": { "distance": { "title": "Distance", "type": "number" }, "id": { "title": "Id", "type": "string" }, "name": { "title": "Name", "type": "string" }, "primary": { "title": "Primary", "type": "boolean" }, "resource_state": { "title": "Resource State", "type": "integer" }, "brand_name": { "title": "Brand Name", "type": "string" }, "description": { "title": "Description", "type": "string" }, "frame_type": { "title": "Frame Type", "type": "integer" }, "model_name": { "title": "Model Name", "type": "string" } } }, "MetaActivity": { "title": "MetaActivity", "type": "object", "properties": { "id": { "title": "Id", "type": "integer" } } }, "MetaAthlete": { "title": "MetaAthlete", "type": "object", "properties": { "id": { "title": "Id", "type": "integer" } } }, "Lap": { "title": "Lap", "type": "object", "properties": { "activity": { "$ref": "#/definitions/MetaActivity" }, "athlete": { "$ref": "#/definitions/MetaAthlete" }, "average_cadence": { "title": "Average Cadence", "type": "number" }, "average_speed": { "title": "Average Speed", "type": "number" }, "distance": { "title": "Distance", "type": "number" }, "elapsed_time": { "title": "Elapsed Time", "type": "integer" }, "end_index": { "title": "End Index", "type": "integer" }, "id": { "title": "Id", "type": "integer" }, "lap_index": { "title": "Lap Index", "type": "integer" }, "max_speed": { "title": "Max Speed", "type": "number" }, "moving_time": { "title": "Moving Time", "type": "integer" }, "name": { "title": "Name", "type": "string" }, "pace_zone": { "title": "Pace Zone", "type": "integer" }, "split": { "title": "Split", "type": "integer" }, "start_date": { "title": "Start Date", "type": "string", "format": "date-time" }, "start_date_local": { "title": "Start Date Local", "type": "string", "format": "date-time" }, "start_index": { "title": "Start Index", "type": "integer" }, "total_elevation_gain": { "title": "Total Elevation Gain", "type": "number" } } }, "ActivityPhotoPrimary": { "title": "ActivityPhotoPrimary", "description": "Represents the primary photo for an activity.\n\nAttributes\n----------\nuse_primary_photo : bool, optional\n Indicates whether the photo is used as the primary photo.\n\nNotes\n-----\nAttributes for activity photos are currently undocumented.", "type": "object", "properties": { "id": { "title": "Id", "type": "integer" }, "source": { "title": "Source", "type": "integer" }, "unique_id": { "title": "Unique Id", "type": "string" }, "urls": { "title": "Urls", "type": "object", "additionalProperties": { "type": "string" } }, "use_primary_photo": { "title": "Use Primary Photo", "type": "boolean" } } }, "ActivityPhotoMeta": { "title": "ActivityPhotoMeta", "description": "Represents the metadata of photos returned with the activity.\n\nNot to be confused with the fully loaded photos for an activity.\n\nAttributes\n----------\nprimary : ActivityPhotoPrimary, optional\n The primary photo for the activity.\nuse_primary_photo : bool, optional\n Indicates whether the primary photo is used. Not currently documented\n by Strava.\n\nNotes\n-----\nUndocumented attributes could be changed by Strava at any time.", "type": "object", "properties": { "count": { "title": "Count", "type": "integer" }, "primary": { "$ref": "#/definitions/ActivityPhotoPrimary" }, "use_primary_photo": { "title": "Use Primary Photo", "type": "boolean" } } }, "SegmentEffortAchievement": { "title": "SegmentEffortAchievement", "description": "An undocumented structure being returned for segment efforts.\n\nNotes\n-----\nUndocumented Strava elements can change at any time without notice.", "type": "object", "properties": { "rank": { "title": "Rank", "type": "integer" }, "type": { "title": "Type", "type": "string" }, "type_id": { "title": "Type Id", "type": "integer" }, "effort_count": { "title": "Effort Count", "type": "integer" } } }, "SegmentEffort": { "title": "SegmentEffort", "description": "Class representing a best effort on a particular segment.", "type": "object", "properties": { "bound_client": { "title": "Bound Client" }, "activity_id": { "title": "Activity Id", "type": "integer" }, "distance": { "title": "Distance", "type": "number" }, "elapsed_time": { "title": "Elapsed Time", "type": "number", "format": "time-delta" }, "id": { "title": "Id", "type": "integer" }, "is_kom": { "title": "Is Kom", "type": "boolean" }, "start_date": { "title": "Start Date", "type": "string", "format": "date-time" }, "start_date_local": { "title": "Start Date Local", "type": "string", "format": "date-time" }, "activity": { "$ref": "#/definitions/Activity" }, "athlete": { "$ref": "#/definitions/Athlete" }, "average_cadence": { "title": "Average Cadence", "type": "number" }, "average_heartrate": { "title": "Average Heartrate", "type": "number" }, "average_watts": { "title": "Average Watts", "type": "number" }, "device_watts": { "title": "Device Watts", "type": "boolean" }, "end_index": { "title": "End Index", "type": "integer" }, "hidden": { "title": "Hidden", "type": "boolean" }, "kom_rank": { "title": "Kom Rank", "minimum": 1, "maximum": 10, "type": "integer" }, "max_heartrate": { "title": "Max Heartrate", "type": "number" }, "moving_time": { "title": "Moving Time", "type": "number", "format": "time-delta" }, "name": { "title": "Name", "type": "string" }, "pr_rank": { "title": "Pr Rank", "minimum": 1, "maximum": 3, "type": "integer" }, "segment": { "$ref": "#/definitions/Segment" }, "start_index": { "title": "Start Index", "type": "integer" }, "achievements": { "title": "Achievements", "type": "array", "items": { "$ref": "#/definitions/SegmentEffortAchievement" } } } }, "Split": { "title": "Split", "description": "A split -- may be metric or standard units (which has no bearing\non the units used in this object, just the binning of values).", "type": "object", "properties": { "average_speed": { "title": "Average Speed", "type": "number" }, "distance": { "title": "Distance", "type": "number" }, "elapsed_time": { "title": "Elapsed Time", "type": "number", "format": "time-delta" }, "elevation_difference": { "title": "Elevation Difference", "type": "number" }, "moving_time": { "title": "Moving Time", "type": "number", "format": "time-delta" }, "pace_zone": { "title": "Pace Zone", "type": "integer" }, "split": { "title": "Split", "type": "integer" }, "average_heartrate": { "title": "Average Heartrate", "type": "number" }, "average_grade_adjusted_speed": { "title": "Average Grade Adjusted Speed", "type": "number" } } }, "Activity": { "title": "Activity", "description": "Represents an activity (ride, run, etc.).", "type": "object", "properties": { "bound_client": { "title": "Bound Client" }, "id": { "title": "Id", "type": "integer" }, "achievement_count": { "title": "Achievement Count", "type": "integer" }, "athlete": { "$ref": "#/definitions/Athlete" }, "athlete_count": { "title": "Athlete Count", "minimum": 1, "type": "integer" }, "average_speed": { "title": "Average Speed", "type": "number" }, "average_watts": { "title": "Average Watts", "type": "number" }, "comment_count": { "title": "Comment Count", "type": "integer" }, "commute": { "title": "Commute", "type": "boolean" }, "device_watts": { "title": "Device Watts", "type": "boolean" }, "distance": { "title": "Distance", "type": "number" }, "elapsed_time": { "title": "Elapsed Time", "type": "number", "format": "time-delta" }, "elev_high": { "title": "Elev High", "type": "number" }, "elev_low": { "title": "Elev Low", "type": "number" }, "end_latlng": { "$ref": "#/definitions/LatLon" }, "external_id": { "title": "External Id", "type": "string" }, "flagged": { "title": "Flagged", "type": "boolean" }, "gear_id": { "title": "Gear Id", "type": "string" }, "has_kudoed": { "title": "Has Kudoed", "type": "boolean" }, "hide_from_home": { "title": "Hide From Home", "type": "boolean" }, "kilojoules": { "title": "Kilojoules", "type": "number" }, "kudos_count": { "title": "Kudos Count", "type": "integer" }, "manual": { "title": "Manual", "type": "boolean" }, "map": { "$ref": "#/definitions/Map" }, "max_speed": { "title": "Max Speed", "type": "number" }, "max_watts": { "title": "Max Watts", "type": "integer" }, "moving_time": { "title": "Moving Time", "type": "number", "format": "time-delta" }, "name": { "title": "Name", "type": "string" }, "photo_count": { "title": "Photo Count", "type": "integer" }, "private": { "title": "Private", "type": "boolean" }, "sport_type": { "$ref": "#/definitions/RelaxedSportType" }, "start_date": { "title": "Start Date", "type": "string", "format": "date-time" }, "start_date_local": { "title": "Start Date Local", "type": "string", "format": "date-time" }, "start_latlng": { "$ref": "#/definitions/LatLon" }, "timezone": { "title": "Timezone", "type": "string" }, "total_elevation_gain": { "title": "Total Elevation Gain", "type": "number" }, "total_photo_count": { "title": "Total Photo Count", "type": "integer" }, "trainer": { "title": "Trainer", "type": "boolean" }, "type": { "$ref": "#/definitions/RelaxedActivityType" }, "upload_id": { "title": "Upload Id", "type": "integer" }, "upload_id_str": { "title": "Upload Id Str", "type": "string" }, "weighted_average_watts": { "title": "Weighted Average Watts", "type": "integer" }, "workout_type": { "title": "Workout Type", "type": "integer" }, "best_efforts": { "title": "Best Efforts", "type": "array", "items": { "$ref": "#/definitions/BestEffort" } }, "calories": { "title": "Calories", "type": "number" }, "description": { "title": "Description", "type": "string" }, "device_name": { "title": "Device Name", "type": "string" }, "embed_token": { "title": "Embed Token", "type": "string" }, "gear": { "$ref": "#/definitions/Gear" }, "laps": { "title": "Laps", "type": "array", "items": { "$ref": "#/definitions/Lap" } }, "photos": { "$ref": "#/definitions/ActivityPhotoMeta" }, "segment_efforts": { "title": "Segment Efforts", "type": "array", "items": { "$ref": "#/definitions/SegmentEffort" } }, "splits_metric": { "title": "Splits Metric", "type": "array", "items": { "$ref": "#/definitions/Split" } }, "splits_standard": { "title": "Splits Standard", "type": "array", "items": { "$ref": "#/definitions/Split" } }, "guid": { "title": "Guid", "type": "string" }, "utc_offset": { "title": "Utc Offset", "type": "number" }, "location_city": { "title": "Location City", "type": "string" }, "location_state": { "title": "Location State", "type": "string" }, "location_country": { "title": "Location Country", "type": "string" }, "start_latitude": { "title": "Start Latitude", "type": "number" }, "start_longitude": { "title": "Start Longitude", "type": "number" }, "pr_count": { "title": "Pr Count", "type": "integer" }, "suffer_score": { "title": "Suffer Score", "type": "integer" }, "has_heartrate": { "title": "Has Heartrate", "type": "boolean" }, "average_heartrate": { "title": "Average Heartrate", "type": "number" }, "max_heartrate": { "title": "Max Heartrate", "type": "integer" }, "average_cadence": { "title": "Average Cadence", "type": "number" }, "average_temp": { "title": "Average Temp", "type": "integer" }, "instagram_primary_photo": { "title": "Instagram Primary Photo", "type": "string" }, "partner_logo_url": { "title": "Partner Logo Url", "type": "string" }, "partner_brand_tag": { "title": "Partner Brand Tag", "type": "string" }, "from_accepted_tag": { "title": "From Accepted Tag", "type": "boolean" }, "segment_leaderboard_opt_out": { "title": "Segment Leaderboard Opt Out", "type": "boolean" }, "perceived_exertion": { "title": "Perceived Exertion", "type": "integer" } } } } }
- Fields:
- Validators:
- field achievement_count: int | None = None#
The number of achievements gained during this activity
- field athlete_count: int | None = None#
The number of athletes for taking part in a group activity
- Constraints:
minimum = 1
- field average_cadence: float | None = None#
- field average_heartrate: float | None = None#
- field average_speed: float | None = None#
The activityโs average speed, in meters per second
- field average_temp: int | None = None#
- field average_watts: float | None = None#
Average power output in watts during this activity. Rides only
- field best_efforts: list[BestEffort] | None = None#
- field bound_client: Any | None = None#
- field calories: float | None = None#
The number of kilocalories consumed during this activity
- field comment_count: int | None = None#
The number of comments for this activity
- field commute: bool | None = None#
Whether this activity is a commute
- field description: str | None = None#
The description of the activity
- field device_name: str | None = None#
The name of the device used to record the activity
- field device_watts: bool | None = None#
Whether the watts are from a power meter, false if estimated
- field distance: float | None = None#
The activityโs distance, in meters
- field elapsed_time: timedelta | None = None#
The activityโs elapsed time, in seconds
- field elev_high: float | None = None#
The activityโs highest elevation, in meters
- field elev_low: float | None = None#
The activityโs lowest elevation, in meters
- field embed_token: str | None = None#
The token used to embed a Strava activity
- field external_id: str | None = None#
The identifier provided at upload time
- field flagged: bool | None = None#
Whether this activity is flagged
- field from_accepted_tag: bool | None = None#
- field gear_id: str | None = None#
The id of the gear for the activity
- field guid: str | None = None#
- field has_heartrate: bool | None = None#
- field has_kudoed: bool | None = None#
Whether the logged-in athlete has kudoed this activity
- field hide_from_home: bool | None = None#
Whether the activity is muted
- field id: int | None = None#
The unique identifier of the activity
- field instagram_primary_photo: str | None = None#
- field kilojoules: float | None = None#
The total work done in kilojoules during this activity. Rides only
- field kudos_count: int | None = None#
The number of kudos given for this activity
- field location_city: str | None = None#
- field location_country: str | None = None#
- field location_state: str | None = None#
- field manual: bool | None = None#
Whether this activity was created manually
- field max_heartrate: int | None = None#
- field max_speed: float | None = None#
The activityโs max speed, in meters per second
- field max_watts: int | None = None#
Rides with power meter data only
- field moving_time: timedelta | None = None#
The activityโs moving time, in seconds
- field name: str | None = None#
The name of the activity
- field partner_brand_tag: str | None = None#
- field partner_logo_url: str | None = None#
- field perceived_exertion: int | None = None#
- field photo_count: int | None = None#
The number of Instagram photos for this activity
- field photos: ActivityPhotoMeta | None = None#
- field pr_count: int | None = None#
- field private: bool | None = None#
Whether this activity is private
- field segment_efforts: list[SegmentEffort] | None = None#
- field segment_leaderboard_opt_out: bool | None = None#
- field splits_metric: list[Split] | None = None#
The splits of this activity in metric units (for runs)
- field splits_standard: list[Split] | None = None#
The splits of this activity in imperial units (for runs)
- field sport_type: RelaxedSportType | None = None#
- field start_date: datetime | None = None#
The time at which the activity was started.
- field start_date_local: datetime | None = None#
The time at which the activity was started in the local timezone.
- Validated by:
- field start_latitude: float | None = None#
- field start_longitude: float | None = None#
- field suffer_score: int | None = None#
- field timezone: str | None = None#
The timezone of the activity
- field total_elevation_gain: float | None = None#
The activityโs total elevation gain.
- field total_photo_count: int | None = None#
The number of Instagram and Strava photos for this activity
- field trainer: bool | None = None#
Whether this activity was recorded on a training machine
- field type: RelaxedActivityType | None = None#
Deprecated. Prefer to use sport_type
- field upload_id: int | None = None#
The identifier of the upload that resulted in this activity
- field upload_id_str: str | None = None#
The unique identifier of the upload in string format
- field utc_offset: float | None = None#
- field weighted_average_watts: int | None = None#
Similar to Normalized Power. Rides with power meter data only
- field workout_type: int | None = None#
The activityโs workout type
- classmethod deserialize(attribute_value_mapping: dict[str, Any]) Self #
Creates and returns a new object based on serialized (dict) struct.
- Parameters:
attribute_value_mapping (dict) โ A dictionary representing the serialized data.
- Returns:
DeprecatedSerializableMixin โ A new instance of the class created from the serialized data.
Deprecated
โโโ-
1.0.0 โ The deserialize() method is deprecated in favor of parse_obj() method. For more details, refer to the Pydantic documentation: https://docs.pydantic.dev/usage/models/#helper-functions
- from_dict(attribute_value_mapping: dict[str, Any]) None #
Deserializes a dict into self, resetting and/or overwriting existing fields.
- Parameters:
attribute_value_mapping (dict) โ A dictionary that will be deserialized into the parent object.
Deprecated
----------
1.0.0 โ The from_dict() method is deprecated in favor of parse_obj() method. For more details, refer to the Pydantic documentation: https://docs.pydantic.dev/usage/models/#helper-functions
- to_dict() dict[str, Any] #
Returns a dict representation of self
- Returns:
dict โ A dictionary containing the data from the instance.
Deprecated
โโโ- โ The to_dict() method is deprecated in favor of dict() method. For more details, refer to the Pydantic documentation: https://docs.pydantic.dev/1.10/usage/exporting_models/
- SPORT_TYPES: ClassVar[tuple[Any, ...]] = ('AlpineSki', 'BackcountrySki', 'Badminton', 'Canoeing', 'Crossfit', 'EBikeRide', 'Elliptical', 'EMountainBikeRide', 'Golf', 'GravelRide', 'Handcycle', 'HighIntensityIntervalTraining', 'Hike', 'IceSkate', 'InlineSkate', 'Kayaking', 'Kitesurf', 'MountainBikeRide', 'NordicSki', 'Pickleball', 'Pilates', 'Racquetball', 'Ride', 'RockClimbing', 'RollerSki', 'Rowing', 'Run', 'Sail', 'Skateboard', 'Snowboard', 'Snowshoe', 'Soccer', 'Squash', 'StairStepper', 'StandUpPaddling', 'Surfing', 'Swim', 'TableTennis', 'Tennis', 'TrailRun', 'Velomobile', 'VirtualRide', 'VirtualRow', 'VirtualRun', 'Walk', 'WeightTraining', 'Wheelchair', 'Windsurf', 'Workout', 'Yoga')#
- TYPES: ClassVar[tuple[Any, ...]] = ('AlpineSki', 'BackcountrySki', 'Canoeing', 'Crossfit', 'EBikeRide', 'Elliptical', 'Golf', 'Handcycle', 'Hike', 'IceSkate', 'InlineSkate', 'Kayaking', 'Kitesurf', 'NordicSki', 'Ride', 'RockClimbing', 'RollerSki', 'Rowing', 'Run', 'Sail', 'Skateboard', 'Snowboard', 'Snowshoe', 'Soccer', 'StairStepper', 'StandUpPaddling', 'Surfing', 'Swim', 'Velomobile', 'VirtualRide', 'VirtualRun', 'Walk', 'WeightTraining', 'Wheelchair', 'Windsurf', 'Workout', 'Yoga')#
- property comments: BatchedResultsIterator[ActivityComment]#
Retrieves comments for a specific activity id.
- property full_photos: BatchedResultsIterator[ActivityPhoto]#
Retrieves activity photos for a specific activity by id.
- property kudos: BatchedResultsIterator[ActivityKudos]#
Retrieves the kudos provided for a specific activity.
- property zones: list[BaseActivityZone]#
Retrieve a list of zones for an activity.
- Returns:
A list of
stravalib.model.BaseActivityZone
objects.- Return type:
py:class:list
- pydantic model stravalib.model.DistributionBucket[source]#
A single distribution bucket object, used for activity zones.
Show JSON schema
{ "title": "DistributionBucket", "description": "A single distribution bucket object, used for activity zones.", "type": "object", "properties": { "max": { "title": "Max", "type": "integer" }, "min": { "title": "Min", "type": "integer" }, "time": { "title": "Time", "type": "integer" } } }
- field max: int | None = None#
The maximum value in the range.
- field min: int | None = None#
The minimum value in the range.
- field time: int | None = None#
The number of seconds spent in this zone
- pydantic model stravalib.model.BaseActivityZone[source]#
Base class for activity zones.
A collection of
stravalib.model.DistributionBucket
objects.Show JSON schema
{ "title": "BaseActivityZone", "description": "Base class for activity zones.\n\nA collection of :class:`stravalib.model.DistributionBucket` objects.", "type": "object", "properties": { "bound_client": { "title": "Bound Client" }, "custom_zones": { "title": "Custom Zones", "type": "boolean" }, "distribution_buckets": { "title": "Distribution Buckets", "type": "array", "items": { "$ref": "#/definitions/DistributionBucket" } }, "max": { "title": "Max", "type": "integer" }, "points": { "title": "Points", "type": "integer" }, "score": { "title": "Score", "type": "integer" }, "sensor_based": { "title": "Sensor Based", "type": "boolean" }, "type": { "title": "Type", "enum": [ "heartrate", "power", "pace" ], "type": "string" } }, "definitions": { "DistributionBucket": { "title": "DistributionBucket", "description": "A single distribution bucket object, used for activity zones.", "type": "object", "properties": { "max": { "title": "Max", "type": "integer" }, "min": { "title": "Min", "type": "integer" }, "time": { "title": "Time", "type": "integer" } } } } }
- Fields:
- field bound_client: Any | None = None#
- field custom_zones: bool | None = None#
- field distribution_buckets: list[DistributionBucket] | None = None#
- field max: int | None = None#
- field points: int | None = None#
- field score: int | None = None#
- field sensor_based: bool | None = None#
- field type: Literal['heartrate', 'power', 'pace'] | None = None#
- classmethod deserialize(attribute_value_mapping: dict[str, Any]) Self #
Creates and returns a new object based on serialized (dict) struct.
- Parameters:
attribute_value_mapping (dict) โ A dictionary representing the serialized data.
- Returns:
DeprecatedSerializableMixin โ A new instance of the class created from the serialized data.
Deprecated
โโโ-
1.0.0 โ The deserialize() method is deprecated in favor of parse_obj() method. For more details, refer to the Pydantic documentation: https://docs.pydantic.dev/usage/models/#helper-functions
- from_dict(attribute_value_mapping: dict[str, Any]) None #
Deserializes a dict into self, resetting and/or overwriting existing fields.
- Parameters:
attribute_value_mapping (dict) โ A dictionary that will be deserialized into the parent object.
Deprecated
----------
1.0.0 โ The from_dict() method is deprecated in favor of parse_obj() method. For more details, refer to the Pydantic documentation: https://docs.pydantic.dev/usage/models/#helper-functions
- to_dict() dict[str, Any] #
Returns a dict representation of self
- Returns:
dict โ A dictionary containing the data from the instance.
Deprecated
โโโ- โ The to_dict() method is deprecated in favor of dict() method. For more details, refer to the Pydantic documentation: https://docs.pydantic.dev/1.10/usage/exporting_models/
- pydantic model stravalib.model.Stream[source]#
Stream of readings from the activity, effort or segment.
Show JSON schema
{ "title": "Stream", "description": "Stream of readings from the activity, effort or segment.", "type": "object", "properties": { "original_size": { "title": "Original Size", "type": "integer" }, "resolution": { "title": "Resolution", "enum": [ "low", "medium", "high" ], "type": "string" }, "series_type": { "title": "Series Type", "enum": [ "distance", "time" ], "type": "string" }, "type": { "title": "Type", "type": "string" }, "data": { "title": "Data", "type": "array", "items": {} } } }
- Fields:
- field data: list[Any] | None = None#
- field original_size: int | None = None#
The number of data points in this stream
- field resolution: Literal['low', 'medium', 'high'] | None = None#
The level of detail (sampling) in which this stream was returned
- field series_type: Literal['distance', 'time'] | None = None#
The base series used in the case the stream was downsampled
- field type: str | None = None#
- classmethod deserialize(attribute_value_mapping: dict[str, Any]) Self #
Creates and returns a new object based on serialized (dict) struct.
- Parameters:
attribute_value_mapping (dict) โ A dictionary representing the serialized data.
- Returns:
DeprecatedSerializableMixin โ A new instance of the class created from the serialized data.
Deprecated
โโโ-
1.0.0 โ The deserialize() method is deprecated in favor of parse_obj() method. For more details, refer to the Pydantic documentation: https://docs.pydantic.dev/usage/models/#helper-functions
- from_dict(attribute_value_mapping: dict[str, Any]) None #
Deserializes a dict into self, resetting and/or overwriting existing fields.
- Parameters:
attribute_value_mapping (dict) โ A dictionary that will be deserialized into the parent object.
Deprecated
----------
1.0.0 โ The from_dict() method is deprecated in favor of parse_obj() method. For more details, refer to the Pydantic documentation: https://docs.pydantic.dev/usage/models/#helper-functions
- to_dict() dict[str, Any] #
Returns a dict representation of self
- Returns:
dict โ A dictionary containing the data from the instance.
Deprecated
โโโ- โ The to_dict() method is deprecated in favor of dict() method. For more details, refer to the Pydantic documentation: https://docs.pydantic.dev/1.10/usage/exporting_models/
- pydantic model stravalib.model.Route[source]#
Represents a Route.
Show JSON schema
{ "title": "Route", "description": "Represents a Route.", "type": "object", "properties": { "bound_client": { "title": "Bound Client" }, "athlete": { "$ref": "#/definitions/Athlete" }, "created_at": { "title": "Created At", "type": "string", "format": "date-time" }, "description": { "title": "Description", "type": "string" }, "distance": { "title": "Distance", "type": "number" }, "elevation_gain": { "title": "Elevation Gain", "type": "number" }, "estimated_moving_time": { "title": "Estimated Moving Time", "type": "integer" }, "id": { "title": "Id", "type": "integer" }, "id_str": { "title": "Id Str", "type": "string" }, "map": { "$ref": "#/definitions/Map" }, "name": { "title": "Name", "type": "string" }, "private": { "title": "Private", "type": "boolean" }, "segments": { "title": "Segments", "type": "array", "items": { "$ref": "#/definitions/Segment" } }, "starred": { "title": "Starred", "type": "boolean" }, "sub_type": { "title": "Sub Type", "type": "integer" }, "timestamp": { "title": "Timestamp", "type": "integer" }, "type": { "title": "Type", "type": "integer" }, "updated_at": { "title": "Updated At", "type": "string", "format": "date-time" }, "waypoints": { "title": "Waypoints", "minItems": 0, "type": "array", "items": { "$ref": "#/definitions/Waypoint" } } }, "definitions": { "SummaryGear": { "title": "SummaryGear", "type": "object", "properties": { "distance": { "title": "Distance", "type": "number" }, "id": { "title": "Id", "type": "string" }, "name": { "title": "Name", "type": "string" }, "primary": { "title": "Primary", "type": "boolean" }, "resource_state": { "title": "Resource State", "type": "integer" } } }, "ActivityType": { "title": "ActivityType", "enum": [ "AlpineSki", "BackcountrySki", "Canoeing", "Crossfit", "EBikeRide", "Elliptical", "Golf", "Handcycle", "Hike", "IceSkate", "InlineSkate", "Kayaking", "Kitesurf", "NordicSki", "Ride", "RockClimbing", "RollerSki", "Rowing", "Run", "Sail", "Skateboard", "Snowboard", "Snowshoe", "Soccer", "StairStepper", "StandUpPaddling", "Surfing", "Swim", "Velomobile", "VirtualRide", "VirtualRun", "Walk", "WeightTraining", "Wheelchair", "Windsurf", "Workout", "Yoga" ], "type": "string" }, "SummaryClub": { "title": "SummaryClub", "type": "object", "properties": { "id": { "title": "Id", "type": "integer" }, "name": { "title": "Name", "type": "string" }, "resource_state": { "title": "Resource State", "type": "integer" }, "activity_types": { "title": "Activity Types", "type": "array", "items": { "$ref": "#/definitions/ActivityType" } }, "city": { "title": "City", "type": "string" }, "country": { "title": "Country", "type": "string" }, "cover_photo": { "title": "Cover Photo", "type": "string" }, "cover_photo_small": { "title": "Cover Photo Small", "type": "string" }, "featured": { "title": "Featured", "type": "boolean" }, "member_count": { "title": "Member Count", "type": "integer" }, "private": { "title": "Private", "type": "boolean" }, "profile_medium": { "title": "Profile Medium", "type": "string" }, "sport_type": { "title": "Sport Type", "enum": [ "cycling", "running", "triathlon", "other" ], "type": "string" }, "state": { "title": "State", "type": "string" }, "url": { "title": "Url", "type": "string" }, "verified": { "title": "Verified", "type": "boolean" } } }, "Athlete": { "title": "Athlete", "description": "Represents high level athlete information including\ntheir name, email, clubs they belong to, bikes, shoes, etc.\n\nNotes\n------\nAlso provides access to detailed athlete stats upon request.\nMany attributes in this object are undocumented by Strava and could be\nmodified at any time.", "type": "object", "properties": { "bound_client": { "title": "Bound Client" }, "id": { "title": "Id", "type": "integer" }, "city": { "title": "City", "type": "string" }, "country": { "title": "Country", "type": "string" }, "created_at": { "title": "Created At", "type": "string", "format": "date-time" }, "firstname": { "title": "Firstname", "type": "string" }, "lastname": { "title": "Lastname", "type": "string" }, "premium": { "title": "Premium", "type": "boolean" }, "profile": { "title": "Profile", "type": "string" }, "profile_medium": { "title": "Profile Medium", "type": "string" }, "resource_state": { "title": "Resource State", "type": "integer" }, "sex": { "title": "Sex", "enum": [ "M", "F" ], "type": "string" }, "state": { "title": "State", "type": "string" }, "summit": { "title": "Summit", "type": "boolean" }, "updated_at": { "title": "Updated At", "type": "string", "format": "date-time" }, "bikes": { "title": "Bikes", "type": "array", "items": { "$ref": "#/definitions/SummaryGear" } }, "clubs": { "title": "Clubs", "type": "array", "items": { "$ref": "#/definitions/SummaryClub" } }, "follower_count": { "title": "Follower Count", "type": "integer" }, "friend_count": { "title": "Friend Count", "type": "integer" }, "ftp": { "title": "Ftp", "type": "integer" }, "measurement_preference": { "title": "Measurement Preference", "enum": [ "feet", "meters" ], "type": "string" }, "shoes": { "title": "Shoes", "type": "array", "items": { "$ref": "#/definitions/SummaryGear" } }, "weight": { "title": "Weight", "type": "number" }, "is_authenticated": { "title": "Is Authenticated", "type": "boolean" }, "athlete_type": { "title": "Athlete Type", "enum": [ "cyclist", "runner" ], "type": "string" }, "friend": { "title": "Friend", "type": "string" }, "follower": { "title": "Follower", "type": "string" }, "approve_followers": { "title": "Approve Followers", "type": "boolean" }, "badge_type_id": { "title": "Badge Type Id", "type": "integer" }, "mutual_friend_count": { "title": "Mutual Friend Count", "type": "integer" }, "date_preference": { "title": "Date Preference", "type": "string" }, "email": { "title": "Email", "type": "string" }, "super_user": { "title": "Super User", "type": "boolean" }, "email_language": { "title": "Email Language", "type": "string" }, "max_heartrate": { "title": "Max Heartrate", "type": "number" }, "username": { "title": "Username", "type": "string" }, "description": { "title": "Description", "type": "string" }, "instagram_username": { "title": "Instagram Username", "type": "string" }, "offer_in_app_payment": { "title": "Offer In App Payment", "type": "boolean" }, "global_privacy": { "title": "Global Privacy", "type": "boolean" }, "receive_newsletter": { "title": "Receive Newsletter", "type": "boolean" }, "email_kom_lost": { "title": "Email Kom Lost", "type": "boolean" }, "dateofbirth": { "title": "Dateofbirth", "type": "string", "format": "date" }, "facebook_sharing_enabled": { "title": "Facebook Sharing Enabled", "type": "boolean" }, "profile_original": { "title": "Profile Original", "type": "string" }, "premium_expiration_date": { "title": "Premium Expiration Date", "type": "integer" }, "email_send_follower_notices": { "title": "Email Send Follower Notices", "type": "boolean" }, "plan": { "title": "Plan", "type": "string" }, "agreed_to_terms": { "title": "Agreed To Terms", "type": "string" }, "follower_request_count": { "title": "Follower Request Count", "type": "integer" }, "email_facebook_twitter_friend_joins": { "title": "Email Facebook Twitter Friend Joins", "type": "boolean" }, "receive_kudos_emails": { "title": "Receive Kudos Emails", "type": "boolean" }, "receive_follower_feed_emails": { "title": "Receive Follower Feed Emails", "type": "boolean" }, "receive_comment_emails": { "title": "Receive Comment Emails", "type": "boolean" }, "sample_race_distance": { "title": "Sample Race Distance", "type": "integer" }, "sample_race_time": { "title": "Sample Race Time", "type": "integer" }, "membership": { "title": "Membership", "type": "string" }, "admin": { "title": "Admin", "type": "boolean" }, "owner": { "title": "Owner", "type": "boolean" }, "subscription_permissions": { "title": "Subscription Permissions", "type": "array", "items": { "type": "boolean" } } } }, "Map": { "title": "Map", "description": "Pass through object. Inherits from PolyLineMap", "type": "object", "properties": { "id": { "title": "Id", "type": "string" }, "polyline": { "title": "Polyline", "type": "string" }, "summary_polyline": { "title": "Summary Polyline", "type": "string" } } }, "RelaxedActivityType": { "title": "RelaxedActivityType", "enum": [ "AlpineSki", "BackcountrySki", "Canoeing", "Crossfit", "EBikeRide", "Elliptical", "Golf", "Handcycle", "Hike", "IceSkate", "InlineSkate", "Kayaking", "Kitesurf", "NordicSki", "Ride", "RockClimbing", "RollerSki", "Rowing", "Run", "Sail", "Skateboard", "Snowboard", "Snowshoe", "Soccer", "StairStepper", "StandUpPaddling", "Surfing", "Swim", "Velomobile", "VirtualRide", "VirtualRun", "Walk", "WeightTraining", "Wheelchair", "Windsurf", "Workout", "Yoga" ], "type": "string" }, "AthletePrEffort": { "title": "AthletePrEffort", "description": "Mixin that intercepts attribute lookup and raises warnings or modifies\nreturn values based on what is defined in the following class attributes:\n\n* _field_conversions\n\nNotes\n------\nThe class attributes below are not yet implemented:\n* _deprecated_fields (TODO)\n* _unsupported_fields (TODO)", "type": "object", "properties": { "effort_count": { "title": "Effort Count", "type": "integer" }, "pr_activity_id": { "title": "Pr Activity Id", "type": "integer" }, "pr_date": { "title": "Pr Date", "type": "string", "format": "date-time" }, "pr_elapsed_time": { "title": "Pr Elapsed Time", "type": "number", "format": "time-delta" }, "distance": { "title": "Distance", "type": "number" }, "start_date": { "title": "Start Date", "type": "string", "format": "date-time" }, "start_date_local": { "title": "Start Date Local", "type": "string", "format": "date-time" }, "is_kom": { "title": "Is Kom", "type": "boolean" } } }, "AthleteSegmentStats": { "title": "AthleteSegmentStats", "description": "A structure being returned for segment stats for current athlete.", "type": "object", "properties": { "activity_id": { "title": "Activity Id", "type": "integer" }, "distance": { "title": "Distance", "type": "number" }, "elapsed_time": { "title": "Elapsed Time", "type": "number", "format": "time-delta" }, "id": { "title": "Id", "type": "integer" }, "is_kom": { "title": "Is Kom", "type": "boolean" }, "start_date": { "title": "Start Date", "type": "string", "format": "date-time" }, "start_date_local": { "title": "Start Date Local", "type": "string", "format": "date-time" }, "effort_count": { "title": "Effort Count", "type": "integer" }, "pr_elapsed_time": { "title": "Pr Elapsed Time", "type": "number", "format": "time-delta" }, "pr_date": { "title": "Pr Date", "type": "string", "format": "date" } } }, "LatLon": { "title": "LatLon", "description": "Enables backward compatibility for legacy namedtuple", "minItems": 2, "maxItems": 2, "type": "array", "items": { "type": "number" } }, "Segment": { "title": "Segment", "description": "Represents a single Strava segment.", "type": "object", "properties": { "bound_client": { "title": "Bound Client" }, "activity_type": { "$ref": "#/definitions/RelaxedActivityType" }, "athlete_pr_effort": { "$ref": "#/definitions/AthletePrEffort" }, "athlete_segment_stats": { "$ref": "#/definitions/AthleteSegmentStats" }, "average_grade": { "title": "Average Grade", "type": "number" }, "city": { "title": "City", "type": "string" }, "climb_category": { "title": "Climb Category", "type": "integer" }, "country": { "title": "Country", "type": "string" }, "distance": { "title": "Distance", "type": "number" }, "elevation_high": { "title": "Elevation High", "type": "number" }, "elevation_low": { "title": "Elevation Low", "type": "number" }, "end_latlng": { "$ref": "#/definitions/LatLon" }, "id": { "title": "Id", "type": "integer" }, "maximum_grade": { "title": "Maximum Grade", "type": "number" }, "name": { "title": "Name", "type": "string" }, "private": { "title": "Private", "type": "boolean" }, "start_latlng": { "$ref": "#/definitions/LatLon" }, "state": { "title": "State", "type": "string" }, "athlete_count": { "title": "Athlete Count", "type": "integer" }, "created_at": { "title": "Created At", "type": "string", "format": "date-time" }, "effort_count": { "title": "Effort Count", "type": "integer" }, "hazardous": { "title": "Hazardous", "type": "boolean" }, "map": { "$ref": "#/definitions/Map" }, "star_count": { "title": "Star Count", "type": "integer" }, "total_elevation_gain": { "title": "Total Elevation Gain", "type": "number" }, "updated_at": { "title": "Updated At", "type": "string", "format": "date-time" }, "start_latitude": { "title": "Start Latitude", "type": "number" }, "end_latitude": { "title": "End Latitude", "type": "number" }, "start_longitude": { "title": "Start Longitude", "type": "number" }, "end_longitude": { "title": "End Longitude", "type": "number" }, "starred": { "title": "Starred", "type": "boolean" }, "pr_time": { "title": "Pr Time", "type": "number", "format": "time-delta" }, "starred_date": { "title": "Starred Date", "type": "string", "format": "date-time" }, "elevation_profile": { "title": "Elevation Profile", "type": "string" } } }, "LatLng": { "title": "LatLng", "description": "A pair of latitude/longitude coordinates, represented as an array of 2 floating point numbers.", "minItems": 2, "maxItems": 2, "type": "array", "items": { "type": "number" } }, "Waypoint": { "title": "Waypoint", "type": "object", "properties": { "categories": { "title": "Categories", "minItems": 0, "type": "array", "items": { "type": "string" } }, "description": { "title": "Description", "type": "string" }, "distance_into_route": { "title": "Distance Into Route", "type": "integer" }, "latlng": { "$ref": "#/definitions/LatLng" }, "target_latlng": { "$ref": "#/definitions/LatLng" }, "title": { "title": "Title", "type": "string" } } } } }
- Fields:
- field bound_client: Any | None = None#
- field created_at: datetime | None = None#
The time at which the route was created
- field description: str | None = None#
The description of the route
- field distance: float | None = None#
The routeโs distance, in meters
- field elevation_gain: float | None = None#
The routeโs elevation gain.
- field estimated_moving_time: int | None = None#
Estimated time in seconds for the authenticated athlete to complete route
- field id: int | None = None#
The unique identifier of this route
- field id_str: str | None = None#
The unique identifier of the route in string format
- field name: str | None = None#
The name of this route
- field private: bool | None = None#
Whether this route is private
- field starred: bool | None = None#
Whether this route is starred by the logged-in athlete
- field sub_type: int | None = None#
This routeโs sub-type (1 for road, 2 for mountain bike, 3 for cross, 4 for trail, 5 for mixed)
- field timestamp: int | None = None#
An epoch timestamp of when the route was created
- field type: int | None = None#
This routeโs type (1 for ride, 2 for runs)
- field updated_at: datetime | None = None#
The time at which the route was last updated
- field waypoints: list[Waypoint] | None = None#
The custom waypoints along this route
- Constraints:
minItems = 0
- classmethod deserialize(attribute_value_mapping: dict[str, Any]) Self #
Creates and returns a new object based on serialized (dict) struct.
- Parameters:
attribute_value_mapping (dict) โ A dictionary representing the serialized data.
- Returns:
DeprecatedSerializableMixin โ A new instance of the class created from the serialized data.
Deprecated
โโโ-
1.0.0 โ The deserialize() method is deprecated in favor of parse_obj() method. For more details, refer to the Pydantic documentation: https://docs.pydantic.dev/usage/models/#helper-functions
- from_dict(attribute_value_mapping: dict[str, Any]) None #
Deserializes a dict into self, resetting and/or overwriting existing fields.
- Parameters:
attribute_value_mapping (dict) โ A dictionary that will be deserialized into the parent object.
Deprecated
----------
1.0.0 โ The from_dict() method is deprecated in favor of parse_obj() method. For more details, refer to the Pydantic documentation: https://docs.pydantic.dev/usage/models/#helper-functions
- to_dict() dict[str, Any] #
Returns a dict representation of self
- Returns:
dict โ A dictionary containing the data from the instance.
Deprecated
โโโ- โ The to_dict() method is deprecated in favor of dict() method. For more details, refer to the Pydantic documentation: https://docs.pydantic.dev/1.10/usage/exporting_models/
- pydantic model stravalib.model.Subscription[source]#
Represents a Webhook Event Subscription.
Show JSON schema
{ "title": "Subscription", "description": "Represents a Webhook Event Subscription.", "type": "object", "properties": { "bound_client": { "title": "Bound Client" }, "id": { "title": "Id", "type": "integer" }, "application_id": { "title": "Application Id", "type": "integer" }, "object_type": { "title": "Object Type", "type": "string" }, "aspect_type": { "title": "Aspect Type", "type": "string" }, "callback_url": { "title": "Callback Url", "type": "string" }, "created_at": { "title": "Created At", "type": "string", "format": "date-time" }, "updated_at": { "title": "Updated At", "type": "string", "format": "date-time" } } }
- Fields:
- field application_id: int | None = None#
- field aspect_type: str | None = None#
- field bound_client: Any | None = None#
- field callback_url: str | None = None#
- field created_at: datetime | None = None#
- field id: int | None = None#
- field object_type: str | None = None#
- field updated_at: datetime | None = None#
- classmethod deserialize(attribute_value_mapping: dict[str, Any]) Self #
Creates and returns a new object based on serialized (dict) struct.
- Parameters:
attribute_value_mapping (dict) โ A dictionary representing the serialized data.
- Returns:
DeprecatedSerializableMixin โ A new instance of the class created from the serialized data.
Deprecated
โโโ-
1.0.0 โ The deserialize() method is deprecated in favor of parse_obj() method. For more details, refer to the Pydantic documentation: https://docs.pydantic.dev/usage/models/#helper-functions
- from_dict(attribute_value_mapping: dict[str, Any]) None #
Deserializes a dict into self, resetting and/or overwriting existing fields.
- Parameters:
attribute_value_mapping (dict) โ A dictionary that will be deserialized into the parent object.
Deprecated
----------
1.0.0 โ The from_dict() method is deprecated in favor of parse_obj() method. For more details, refer to the Pydantic documentation: https://docs.pydantic.dev/usage/models/#helper-functions
- to_dict() dict[str, Any] #
Returns a dict representation of self
- Returns:
dict โ A dictionary containing the data from the instance.
Deprecated
โโโ- โ The to_dict() method is deprecated in favor of dict() method. For more details, refer to the Pydantic documentation: https://docs.pydantic.dev/1.10/usage/exporting_models/
- ASPECT_TYPE_CREATE: ClassVar[str] = 'create'#
- OBJECT_TYPE_ACTIVITY: ClassVar[str] = 'activity'#
- VERIFY_TOKEN_DEFAULT: ClassVar[str] = 'STRAVA'#
- pydantic model stravalib.model.SubscriptionCallback[source]#
Represents a Webhook Event Subscription Callback.
Show JSON schema
{ "title": "SubscriptionCallback", "description": "Represents a Webhook Event Subscription Callback.", "type": "object", "properties": { "hub.mode": { "title": "Hub.Mode", "type": "string" }, "hub.verify_token": { "title": "Hub.Verify Token", "type": "string" }, "hub.challenge": { "title": "Hub.Challenge", "type": "string" } } }
- field hub_challenge: str | None = None (alias 'hub.challenge')#
- field hub_mode: str | None = None (alias 'hub.mode')#
- field hub_verify_token: str | None = None (alias 'hub.verify_token')#
- classmethod deserialize(attribute_value_mapping: dict[str, Any]) Self #
Creates and returns a new object based on serialized (dict) struct.
- Parameters:
attribute_value_mapping (dict) โ A dictionary representing the serialized data.
- Returns:
DeprecatedSerializableMixin โ A new instance of the class created from the serialized data.
Deprecated
โโโ-
1.0.0 โ The deserialize() method is deprecated in favor of parse_obj() method. For more details, refer to the Pydantic documentation: https://docs.pydantic.dev/usage/models/#helper-functions
- from_dict(attribute_value_mapping: dict[str, Any]) None #
Deserializes a dict into self, resetting and/or overwriting existing fields.
- Parameters:
attribute_value_mapping (dict) โ A dictionary that will be deserialized into the parent object.
Deprecated
----------
1.0.0 โ The from_dict() method is deprecated in favor of parse_obj() method. For more details, refer to the Pydantic documentation: https://docs.pydantic.dev/usage/models/#helper-functions
- to_dict() dict[str, Any] #
Returns a dict representation of self
- Returns:
dict โ A dictionary containing the data from the instance.
Deprecated
โโโ- โ The to_dict() method is deprecated in favor of dict() method. For more details, refer to the Pydantic documentation: https://docs.pydantic.dev/1.10/usage/exporting_models/
- validate_token(verify_token: str = 'STRAVA') None [source]#
Validate the subscriptionโs hub_verify_token against the provided token.
- Parameters:
verify_token (str) โ The token to verify subscription If not provided, it uses the default VERIFY_TOKEN_DEFAULT.
- Returns:
None if an assertion error is not raised
- Return type:
None
- Raises:
AssertionError โ If the hub_verify_token does not match the provided verify_token.
- pydantic model stravalib.model.SubscriptionUpdate[source]#
Represents a Webhook Event Subscription Update.
Show JSON schema
{ "title": "SubscriptionUpdate", "description": "Represents a Webhook Event Subscription Update.", "type": "object", "properties": { "bound_client": { "title": "Bound Client" }, "subscription_id": { "title": "Subscription Id", "type": "integer" }, "owner_id": { "title": "Owner Id", "type": "integer" }, "object_id": { "title": "Object Id", "type": "integer" }, "object_type": { "title": "Object Type", "type": "string" }, "aspect_type": { "title": "Aspect Type", "type": "string" }, "event_time": { "title": "Event Time", "type": "string", "format": "date-time" }, "updates": { "title": "Updates", "type": "object" } } }
- Fields:
- field aspect_type: str | None = None#
- field bound_client: Any | None = None#
- field event_time: datetime | None = None#
- field object_id: int | None = None#
- field object_type: str | None = None#
- field owner_id: int | None = None#
- field subscription_id: int | None = None#
- field updates: dict[str, Any] | None = None#
- classmethod deserialize(attribute_value_mapping: dict[str, Any]) Self #
Creates and returns a new object based on serialized (dict) struct.
- Parameters:
attribute_value_mapping (dict) โ A dictionary representing the serialized data.
- Returns:
DeprecatedSerializableMixin โ A new instance of the class created from the serialized data.
Deprecated
โโโ-
1.0.0 โ The deserialize() method is deprecated in favor of parse_obj() method. For more details, refer to the Pydantic documentation: https://docs.pydantic.dev/usage/models/#helper-functions
- from_dict(attribute_value_mapping: dict[str, Any]) None #
Deserializes a dict into self, resetting and/or overwriting existing fields.
- Parameters:
attribute_value_mapping (dict) โ A dictionary that will be deserialized into the parent object.
Deprecated
----------
1.0.0 โ The from_dict() method is deprecated in favor of parse_obj() method. For more details, refer to the Pydantic documentation: https://docs.pydantic.dev/usage/models/#helper-functions
- to_dict() dict[str, Any] #
Returns a dict representation of self
- Returns:
dict โ A dictionary containing the data from the instance.
Deprecated
โโโ- โ The to_dict() method is deprecated in favor of dict() method. For more details, refer to the Pydantic documentation: https://docs.pydantic.dev/1.10/usage/exporting_models/