otf-api 0.13.1__tar.gz → 0.13.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {otf_api-0.13.1/src/otf_api.egg-info → otf_api-0.13.3}/PKG-INFO +1 -1
- {otf_api-0.13.1 → otf_api-0.13.3}/pyproject.toml +1 -1
- {otf_api-0.13.1 → otf_api-0.13.3}/src/otf_api/__init__.py +1 -1
- {otf_api-0.13.1 → otf_api-0.13.3}/src/otf_api/api/bookings/booking_api.py +1 -1
- {otf_api-0.13.1 → otf_api-0.13.3}/src/otf_api/api/workouts/workout_api.py +4 -3
- {otf_api-0.13.1 → otf_api-0.13.3}/src/otf_api/models/mixins.py +1 -2
- {otf_api-0.13.1 → otf_api-0.13.3/src/otf_api.egg-info}/PKG-INFO +1 -1
- {otf_api-0.13.1 → otf_api-0.13.3}/LICENSE +0 -0
- {otf_api-0.13.1 → otf_api-0.13.3}/README.md +0 -0
- {otf_api-0.13.1 → otf_api-0.13.3}/setup.cfg +0 -0
- {otf_api-0.13.1 → otf_api-0.13.3}/src/otf_api/api/__init__.py +0 -0
- {otf_api-0.13.1 → otf_api-0.13.3}/src/otf_api/api/_compat.py +0 -0
- {otf_api-0.13.1 → otf_api-0.13.3}/src/otf_api/api/api.py +0 -0
- {otf_api-0.13.1 → otf_api-0.13.3}/src/otf_api/api/bookings/__init__.py +0 -0
- {otf_api-0.13.1 → otf_api-0.13.3}/src/otf_api/api/bookings/booking_client.py +0 -0
- {otf_api-0.13.1 → otf_api-0.13.3}/src/otf_api/api/client.py +0 -0
- {otf_api-0.13.1 → otf_api-0.13.3}/src/otf_api/api/members/__init__.py +0 -0
- {otf_api-0.13.1 → otf_api-0.13.3}/src/otf_api/api/members/member_api.py +0 -0
- {otf_api-0.13.1 → otf_api-0.13.3}/src/otf_api/api/members/member_client.py +0 -0
- {otf_api-0.13.1 → otf_api-0.13.3}/src/otf_api/api/studios/__init__.py +0 -0
- {otf_api-0.13.1 → otf_api-0.13.3}/src/otf_api/api/studios/studio_api.py +0 -0
- {otf_api-0.13.1 → otf_api-0.13.3}/src/otf_api/api/studios/studio_client.py +0 -0
- {otf_api-0.13.1 → otf_api-0.13.3}/src/otf_api/api/utils.py +0 -0
- {otf_api-0.13.1 → otf_api-0.13.3}/src/otf_api/api/workouts/__init__.py +0 -0
- {otf_api-0.13.1 → otf_api-0.13.3}/src/otf_api/api/workouts/workout_client.py +0 -0
- {otf_api-0.13.1 → otf_api-0.13.3}/src/otf_api/auth/__init__.py +0 -0
- {otf_api-0.13.1 → otf_api-0.13.3}/src/otf_api/auth/auth.py +0 -0
- {otf_api-0.13.1 → otf_api-0.13.3}/src/otf_api/auth/user.py +0 -0
- {otf_api-0.13.1 → otf_api-0.13.3}/src/otf_api/auth/utils.py +0 -0
- {otf_api-0.13.1 → otf_api-0.13.3}/src/otf_api/cache.py +0 -0
- {otf_api-0.13.1 → otf_api-0.13.3}/src/otf_api/exceptions.py +0 -0
- {otf_api-0.13.1 → otf_api-0.13.3}/src/otf_api/models/__init__.py +0 -0
- {otf_api-0.13.1 → otf_api-0.13.3}/src/otf_api/models/base.py +0 -0
- {otf_api-0.13.1 → otf_api-0.13.3}/src/otf_api/models/bookings/__init__.py +0 -0
- {otf_api-0.13.1 → otf_api-0.13.3}/src/otf_api/models/bookings/bookings.py +0 -0
- {otf_api-0.13.1 → otf_api-0.13.3}/src/otf_api/models/bookings/bookings_v2.py +0 -0
- {otf_api-0.13.1 → otf_api-0.13.3}/src/otf_api/models/bookings/classes.py +0 -0
- {otf_api-0.13.1 → otf_api-0.13.3}/src/otf_api/models/bookings/enums.py +0 -0
- {otf_api-0.13.1 → otf_api-0.13.3}/src/otf_api/models/bookings/filters.py +0 -0
- {otf_api-0.13.1 → otf_api-0.13.3}/src/otf_api/models/bookings/ratings.py +0 -0
- {otf_api-0.13.1 → otf_api-0.13.3}/src/otf_api/models/members/__init__.py +0 -0
- {otf_api-0.13.1 → otf_api-0.13.3}/src/otf_api/models/members/member_detail.py +0 -0
- {otf_api-0.13.1 → otf_api-0.13.3}/src/otf_api/models/members/member_membership.py +0 -0
- {otf_api-0.13.1 → otf_api-0.13.3}/src/otf_api/models/members/member_purchases.py +0 -0
- {otf_api-0.13.1 → otf_api-0.13.3}/src/otf_api/models/members/notifications.py +0 -0
- {otf_api-0.13.1 → otf_api-0.13.3}/src/otf_api/models/studios/__init__.py +0 -0
- {otf_api-0.13.1 → otf_api-0.13.3}/src/otf_api/models/studios/enums.py +0 -0
- {otf_api-0.13.1 → otf_api-0.13.3}/src/otf_api/models/studios/studio_detail.py +0 -0
- {otf_api-0.13.1 → otf_api-0.13.3}/src/otf_api/models/studios/studio_services.py +0 -0
- {otf_api-0.13.1 → otf_api-0.13.3}/src/otf_api/models/workouts/__init__.py +0 -0
- {otf_api-0.13.1 → otf_api-0.13.3}/src/otf_api/models/workouts/body_composition_list.py +0 -0
- {otf_api-0.13.1 → otf_api-0.13.3}/src/otf_api/models/workouts/challenge_tracker_content.py +0 -0
- {otf_api-0.13.1 → otf_api-0.13.3}/src/otf_api/models/workouts/challenge_tracker_detail.py +0 -0
- {otf_api-0.13.1 → otf_api-0.13.3}/src/otf_api/models/workouts/enums.py +0 -0
- {otf_api-0.13.1 → otf_api-0.13.3}/src/otf_api/models/workouts/lifetime_stats.py +0 -0
- {otf_api-0.13.1 → otf_api-0.13.3}/src/otf_api/models/workouts/out_of_studio_workout_history.py +0 -0
- {otf_api-0.13.1 → otf_api-0.13.3}/src/otf_api/models/workouts/performance_summary.py +0 -0
- {otf_api-0.13.1 → otf_api-0.13.3}/src/otf_api/models/workouts/telemetry.py +0 -0
- {otf_api-0.13.1 → otf_api-0.13.3}/src/otf_api/models/workouts/workout.py +0 -0
- {otf_api-0.13.1 → otf_api-0.13.3}/src/otf_api/py.typed +0 -0
- {otf_api-0.13.1 → otf_api-0.13.3}/src/otf_api.egg-info/SOURCES.txt +0 -0
- {otf_api-0.13.1 → otf_api-0.13.3}/src/otf_api.egg-info/dependency_links.txt +0 -0
- {otf_api-0.13.1 → otf_api-0.13.3}/src/otf_api.egg-info/requires.txt +0 -0
- {otf_api-0.13.1 → otf_api-0.13.3}/src/otf_api.egg-info/top_level.txt +0 -0
- {otf_api-0.13.1 → otf_api-0.13.3}/tests/test_filters.py +0 -0
@@ -188,7 +188,7 @@ class BookingApi:
|
|
188
188
|
for c in classes_resp:
|
189
189
|
c["studio"] = studio_dict[c["studio"]["id"]] # the one (?) place where ID actually means UUID
|
190
190
|
c["is_home_studio"] = c["studio"].studio_uuid == self.otf.home_studio_uuid
|
191
|
-
classes.append(models.OtfClass(**c))
|
191
|
+
classes.append(models.OtfClass.create(**c, api=self.otf))
|
192
192
|
|
193
193
|
# additional data filtering and enrichment
|
194
194
|
|
@@ -242,13 +242,14 @@ class WorkoutApi:
|
|
242
242
|
return workout
|
243
243
|
|
244
244
|
def get_workouts(
|
245
|
-
self, start_date: date | str | None = None, end_date: date | str | None = None
|
245
|
+
self, start_date: date | str | None = None, end_date: date | str | None = None, max_data_points: int = 150
|
246
246
|
) -> list[models.Workout]:
|
247
247
|
"""Get the member's workouts, using the new bookings endpoint and the performance summary endpoint.
|
248
248
|
|
249
249
|
Args:
|
250
250
|
start_date (date | str | None): The start date for the workouts. If None, defaults to 30 days ago.
|
251
251
|
end_date (date | str | None): The end date for the workouts. If None, defaults to today.
|
252
|
+
max_data_points (int): The maximum number of data points to return for the telemetry. Default is 150.
|
252
253
|
|
253
254
|
Returns:
|
254
255
|
list[Workout]: The member's workouts.
|
@@ -265,7 +266,7 @@ class WorkoutApi:
|
|
265
266
|
bookings_dict = {b.workout.id: b for b in bookings if b.workout}
|
266
267
|
|
267
268
|
perf_summaries_dict = self.client.get_perf_summaries_threaded(list(bookings_dict.keys()))
|
268
|
-
telemetry_dict = self.client.get_telemetry_threaded(list(perf_summaries_dict.keys()))
|
269
|
+
telemetry_dict = self.client.get_telemetry_threaded(list(perf_summaries_dict.keys()), max_data_points)
|
269
270
|
perf_summary_to_class_uuid_map = self.client.get_perf_summary_to_class_uuid_mapping()
|
270
271
|
|
271
272
|
workouts: list[models.Workout] = []
|
@@ -275,7 +276,7 @@ class WorkoutApi:
|
|
275
276
|
v2_booking=bookings_dict[perf_id],
|
276
277
|
telemetry=telemetry_dict.get(perf_id),
|
277
278
|
class_uuid=perf_summary_to_class_uuid_map.get(perf_id),
|
278
|
-
api=self,
|
279
|
+
api=self.otf,
|
279
280
|
)
|
280
281
|
workouts.append(workout)
|
281
282
|
|
@@ -22,9 +22,8 @@ class ApiMixin:
|
|
22
22
|
self._api = api
|
23
23
|
|
24
24
|
@classmethod
|
25
|
-
def create(cls, **kwargs) -> typing.Self:
|
25
|
+
def create(cls, api: "Otf", **kwargs) -> typing.Self:
|
26
26
|
"""Creates a new instance of the model with the given keyword arguments."""
|
27
|
-
api = kwargs.pop("api", None)
|
28
27
|
instance = cls(**kwargs)
|
29
28
|
if api is not None:
|
30
29
|
instance.set_api(api)
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{otf_api-0.13.1 → otf_api-0.13.3}/src/otf_api/models/workouts/out_of_studio_workout_history.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|