otf-api 0.13.0__tar.gz → 0.13.2__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.0/src/otf_api.egg-info → otf_api-0.13.2}/PKG-INFO +1 -1
- {otf_api-0.13.0 → otf_api-0.13.2}/pyproject.toml +1 -1
- {otf_api-0.13.0 → otf_api-0.13.2}/src/otf_api/__init__.py +1 -1
- {otf_api-0.13.0 → otf_api-0.13.2}/src/otf_api/api/bookings/booking_api.py +5 -5
- {otf_api-0.13.0 → otf_api-0.13.2}/src/otf_api/api/members/member_api.py +2 -2
- {otf_api-0.13.0 → otf_api-0.13.2}/src/otf_api/api/studios/studio_api.py +6 -5
- {otf_api-0.13.0 → otf_api-0.13.2}/src/otf_api/api/workouts/workout_api.py +2 -2
- {otf_api-0.13.0 → otf_api-0.13.2}/src/otf_api/models/mixins.py +1 -2
- {otf_api-0.13.0 → otf_api-0.13.2/src/otf_api.egg-info}/PKG-INFO +1 -1
- {otf_api-0.13.0 → otf_api-0.13.2}/LICENSE +0 -0
- {otf_api-0.13.0 → otf_api-0.13.2}/README.md +0 -0
- {otf_api-0.13.0 → otf_api-0.13.2}/setup.cfg +0 -0
- {otf_api-0.13.0 → otf_api-0.13.2}/src/otf_api/api/__init__.py +0 -0
- {otf_api-0.13.0 → otf_api-0.13.2}/src/otf_api/api/_compat.py +0 -0
- {otf_api-0.13.0 → otf_api-0.13.2}/src/otf_api/api/api.py +0 -0
- {otf_api-0.13.0 → otf_api-0.13.2}/src/otf_api/api/bookings/__init__.py +0 -0
- {otf_api-0.13.0 → otf_api-0.13.2}/src/otf_api/api/bookings/booking_client.py +0 -0
- {otf_api-0.13.0 → otf_api-0.13.2}/src/otf_api/api/client.py +0 -0
- {otf_api-0.13.0 → otf_api-0.13.2}/src/otf_api/api/members/__init__.py +0 -0
- {otf_api-0.13.0 → otf_api-0.13.2}/src/otf_api/api/members/member_client.py +0 -0
- {otf_api-0.13.0 → otf_api-0.13.2}/src/otf_api/api/studios/__init__.py +0 -0
- {otf_api-0.13.0 → otf_api-0.13.2}/src/otf_api/api/studios/studio_client.py +0 -0
- {otf_api-0.13.0 → otf_api-0.13.2}/src/otf_api/api/utils.py +0 -0
- {otf_api-0.13.0 → otf_api-0.13.2}/src/otf_api/api/workouts/__init__.py +0 -0
- {otf_api-0.13.0 → otf_api-0.13.2}/src/otf_api/api/workouts/workout_client.py +0 -0
- {otf_api-0.13.0 → otf_api-0.13.2}/src/otf_api/auth/__init__.py +0 -0
- {otf_api-0.13.0 → otf_api-0.13.2}/src/otf_api/auth/auth.py +0 -0
- {otf_api-0.13.0 → otf_api-0.13.2}/src/otf_api/auth/user.py +0 -0
- {otf_api-0.13.0 → otf_api-0.13.2}/src/otf_api/auth/utils.py +0 -0
- {otf_api-0.13.0 → otf_api-0.13.2}/src/otf_api/cache.py +0 -0
- {otf_api-0.13.0 → otf_api-0.13.2}/src/otf_api/exceptions.py +0 -0
- {otf_api-0.13.0 → otf_api-0.13.2}/src/otf_api/models/__init__.py +0 -0
- {otf_api-0.13.0 → otf_api-0.13.2}/src/otf_api/models/base.py +0 -0
- {otf_api-0.13.0 → otf_api-0.13.2}/src/otf_api/models/bookings/__init__.py +0 -0
- {otf_api-0.13.0 → otf_api-0.13.2}/src/otf_api/models/bookings/bookings.py +0 -0
- {otf_api-0.13.0 → otf_api-0.13.2}/src/otf_api/models/bookings/bookings_v2.py +0 -0
- {otf_api-0.13.0 → otf_api-0.13.2}/src/otf_api/models/bookings/classes.py +0 -0
- {otf_api-0.13.0 → otf_api-0.13.2}/src/otf_api/models/bookings/enums.py +0 -0
- {otf_api-0.13.0 → otf_api-0.13.2}/src/otf_api/models/bookings/filters.py +0 -0
- {otf_api-0.13.0 → otf_api-0.13.2}/src/otf_api/models/bookings/ratings.py +0 -0
- {otf_api-0.13.0 → otf_api-0.13.2}/src/otf_api/models/members/__init__.py +0 -0
- {otf_api-0.13.0 → otf_api-0.13.2}/src/otf_api/models/members/member_detail.py +0 -0
- {otf_api-0.13.0 → otf_api-0.13.2}/src/otf_api/models/members/member_membership.py +0 -0
- {otf_api-0.13.0 → otf_api-0.13.2}/src/otf_api/models/members/member_purchases.py +0 -0
- {otf_api-0.13.0 → otf_api-0.13.2}/src/otf_api/models/members/notifications.py +0 -0
- {otf_api-0.13.0 → otf_api-0.13.2}/src/otf_api/models/studios/__init__.py +0 -0
- {otf_api-0.13.0 → otf_api-0.13.2}/src/otf_api/models/studios/enums.py +0 -0
- {otf_api-0.13.0 → otf_api-0.13.2}/src/otf_api/models/studios/studio_detail.py +0 -0
- {otf_api-0.13.0 → otf_api-0.13.2}/src/otf_api/models/studios/studio_services.py +0 -0
- {otf_api-0.13.0 → otf_api-0.13.2}/src/otf_api/models/workouts/__init__.py +0 -0
- {otf_api-0.13.0 → otf_api-0.13.2}/src/otf_api/models/workouts/body_composition_list.py +0 -0
- {otf_api-0.13.0 → otf_api-0.13.2}/src/otf_api/models/workouts/challenge_tracker_content.py +0 -0
- {otf_api-0.13.0 → otf_api-0.13.2}/src/otf_api/models/workouts/challenge_tracker_detail.py +0 -0
- {otf_api-0.13.0 → otf_api-0.13.2}/src/otf_api/models/workouts/enums.py +0 -0
- {otf_api-0.13.0 → otf_api-0.13.2}/src/otf_api/models/workouts/lifetime_stats.py +0 -0
- {otf_api-0.13.0 → otf_api-0.13.2}/src/otf_api/models/workouts/out_of_studio_workout_history.py +0 -0
- {otf_api-0.13.0 → otf_api-0.13.2}/src/otf_api/models/workouts/performance_summary.py +0 -0
- {otf_api-0.13.0 → otf_api-0.13.2}/src/otf_api/models/workouts/telemetry.py +0 -0
- {otf_api-0.13.0 → otf_api-0.13.2}/src/otf_api/models/workouts/workout.py +0 -0
- {otf_api-0.13.0 → otf_api-0.13.2}/src/otf_api/py.typed +0 -0
- {otf_api-0.13.0 → otf_api-0.13.2}/src/otf_api.egg-info/SOURCES.txt +0 -0
- {otf_api-0.13.0 → otf_api-0.13.2}/src/otf_api.egg-info/dependency_links.txt +0 -0
- {otf_api-0.13.0 → otf_api-0.13.2}/src/otf_api.egg-info/requires.txt +0 -0
- {otf_api-0.13.0 → otf_api-0.13.2}/src/otf_api.egg-info/top_level.txt +0 -0
- {otf_api-0.13.0 → otf_api-0.13.2}/tests/test_filters.py +0 -0
@@ -80,7 +80,7 @@ class BookingApi:
|
|
80
80
|
ends_before=end_date, starts_after=start_date, include_canceled=include_canceled, expand=expand
|
81
81
|
)
|
82
82
|
|
83
|
-
results = [models.BookingV2.create(**b, api=self) for b in bookings_resp]
|
83
|
+
results = [models.BookingV2.create(**b, api=self.otf) for b in bookings_resp]
|
84
84
|
|
85
85
|
if not remove_duplicates:
|
86
86
|
return results
|
@@ -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
|
|
@@ -228,7 +228,7 @@ class BookingApi:
|
|
228
228
|
raise ValueError("booking_uuid is required")
|
229
229
|
|
230
230
|
data = self.client.get_booking(booking_uuid)
|
231
|
-
return models.Booking.create(**data, api=self)
|
231
|
+
return models.Booking.create(**data, api=self.otf)
|
232
232
|
|
233
233
|
def get_booking_from_class(self, otf_class: str | models.OtfClass) -> models.Booking:
|
234
234
|
"""Get a specific booking by class_uuid or OtfClass object.
|
@@ -337,7 +337,7 @@ class BookingApi:
|
|
337
337
|
|
338
338
|
resp = self.client.post_class_new(body)
|
339
339
|
|
340
|
-
new_booking = models.BookingV2.create(**resp, api=self)
|
340
|
+
new_booking = models.BookingV2.create(**resp, api=self.otf)
|
341
341
|
|
342
342
|
return new_booking
|
343
343
|
|
@@ -443,7 +443,7 @@ class BookingApi:
|
|
443
443
|
b["class"]["studio"] = studios[b["class"]["studio"]["studioUUId"]]
|
444
444
|
b["is_home_studio"] = b["class"]["studio"].studio_uuid == self.otf.home_studio_uuid
|
445
445
|
|
446
|
-
bookings = [models.Booking.create(**b, api=self) for b in resp]
|
446
|
+
bookings = [models.Booking.create(**b, api=self.otf) for b in resp]
|
447
447
|
bookings = sorted(bookings, key=lambda x: x.otf_class.starts_at)
|
448
448
|
|
449
449
|
if exclude_cancelled:
|
@@ -134,7 +134,7 @@ class MemberApi:
|
|
134
134
|
|
135
135
|
res = self.client.put_member_name(first_name, last_name)
|
136
136
|
|
137
|
-
return models.MemberDetail.create(**res, api=self)
|
137
|
+
return models.MemberDetail.create(**res, api=self.otf)
|
138
138
|
|
139
139
|
def get_member_detail(self) -> models.MemberDetail:
|
140
140
|
"""Get the member details.
|
@@ -148,7 +148,7 @@ class MemberApi:
|
|
148
148
|
home_studio_uuid = data["homeStudio"]["studioUUId"]
|
149
149
|
data["home_studio"] = self.otf.studios.get_studio_detail(home_studio_uuid)
|
150
150
|
|
151
|
-
return models.MemberDetail.create(**data, api=self)
|
151
|
+
return models.MemberDetail.create(**data, api=self.otf)
|
152
152
|
|
153
153
|
def get_member_membership(self) -> models.MemberMembership:
|
154
154
|
"""Get the member's membership details.
|
@@ -56,7 +56,7 @@ class StudioApi:
|
|
56
56
|
|
57
57
|
new_faves = resp.get("studios", [])
|
58
58
|
|
59
|
-
return [models.StudioDetail.create(**studio, api=self) for studio in new_faves]
|
59
|
+
return [models.StudioDetail.create(**studio, api=self.otf) for studio in new_faves]
|
60
60
|
|
61
61
|
def remove_favorite_studio(self, studio_uuids: list[str] | str) -> None:
|
62
62
|
"""Remove a studio from the member's favorite studios.
|
@@ -116,7 +116,7 @@ class StudioApi:
|
|
116
116
|
except exc.ResourceNotFoundError:
|
117
117
|
return models.StudioDetail.create_empty_model(studio_uuid)
|
118
118
|
|
119
|
-
return models.StudioDetail.create(**res, api=self)
|
119
|
+
return models.StudioDetail.create(**res, api=self.otf)
|
120
120
|
|
121
121
|
def get_studios_by_geo(
|
122
122
|
self, latitude: float | None = None, longitude: float | None = None
|
@@ -141,7 +141,7 @@ class StudioApi:
|
|
141
141
|
longitude = longitude or self.otf.home_studio.location.longitude
|
142
142
|
|
143
143
|
results = self.client.get_studios_by_geo(latitude, longitude, distance)
|
144
|
-
return [models.StudioDetail.create(**studio, api=self) for studio in results]
|
144
|
+
return [models.StudioDetail.create(**studio, api=self.otf) for studio in results]
|
145
145
|
|
146
146
|
def _get_all_studios(self) -> list[models.StudioDetail]:
|
147
147
|
"""Gets all studios. Marked as private to avoid random users calling it.
|
@@ -153,7 +153,7 @@ class StudioApi:
|
|
153
153
|
"""
|
154
154
|
# long/lat being None will cause the endpoint to return all studios
|
155
155
|
results = self.client.get_studios_by_geo(None, None)
|
156
|
-
return [models.StudioDetail.create(**studio, api=self) for studio in results]
|
156
|
+
return [models.StudioDetail.create(**studio, api=self.otf) for studio in results]
|
157
157
|
|
158
158
|
def _get_studio_detail_threaded(self, studio_uuids: list[str]) -> dict[str, models.StudioDetail]:
|
159
159
|
"""Get detailed information about multiple studios in a threaded manner.
|
@@ -169,5 +169,6 @@ class StudioApi:
|
|
169
169
|
"""
|
170
170
|
studio_dicts = self.client.get_studio_detail_threaded(studio_uuids)
|
171
171
|
return {
|
172
|
-
studio_uuid: models.StudioDetail.create(**studio, api=self
|
172
|
+
studio_uuid: models.StudioDetail.create(**studio, api=self.otf)
|
173
|
+
for studio_uuid, studio in studio_dicts.items()
|
173
174
|
}
|
@@ -237,7 +237,7 @@ class WorkoutApi:
|
|
237
237
|
|
238
238
|
perf_summary = self.client.get_performance_summary(booking.workout.performance_summary_id)
|
239
239
|
telemetry = self.get_telemetry(booking.workout.performance_summary_id)
|
240
|
-
workout = models.Workout.create(**perf_summary, v2_booking=booking, telemetry=telemetry, api=self)
|
240
|
+
workout = models.Workout.create(**perf_summary, v2_booking=booking, telemetry=telemetry, api=self.otf)
|
241
241
|
|
242
242
|
return workout
|
243
243
|
|
@@ -275,7 +275,7 @@ class WorkoutApi:
|
|
275
275
|
v2_booking=bookings_dict[perf_id],
|
276
276
|
telemetry=telemetry_dict.get(perf_id),
|
277
277
|
class_uuid=perf_summary_to_class_uuid_map.get(perf_id),
|
278
|
-
api=self,
|
278
|
+
api=self.otf,
|
279
279
|
)
|
280
280
|
workouts.append(workout)
|
281
281
|
|
@@ -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
|
{otf_api-0.13.0 → otf_api-0.13.2}/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
|