stravalib.model.check_valid_location#
- stravalib.model.check_valid_location(location: Sequence[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. This function is used to validate LatLon object inputs
- 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