otf-api 0.13.1__py3-none-any.whl → 0.13.3__py3-none-any.whl

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/__init__.py CHANGED
@@ -36,7 +36,7 @@ def _setup_logging() -> None:
36
36
 
37
37
  _setup_logging()
38
38
 
39
- __version__ = "0.13.1"
39
+ __version__ = "0.13.3"
40
40
 
41
41
 
42
42
  __all__ = ["Otf", "OtfUser", "models"]
@@ -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
 
otf_api/models/mixins.py CHANGED
@@ -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)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: otf-api
3
- Version: 0.13.1
3
+ Version: 0.13.3
4
4
  Summary: Python OrangeTheory Fitness API Client
5
5
  Author-email: Jessica Smith <j.smith.git1@gmail.com>
6
6
  License-Expression: MIT
@@ -1,4 +1,4 @@
1
- otf_api/__init__.py,sha256=UVe6anFrCEDSyaihjB-L2TMKKyp-1BZBb1ivSEe9tx4,1150
1
+ otf_api/__init__.py,sha256=wLSKVUz_BoJyI2Cha5FfcxPUnjya0I6bqiPPeOgCAjk,1150
2
2
  otf_api/cache.py,sha256=m4xUBhaS0MkcZypon1jjfhJzZPRQBE5Fto4_RMReXZ0,4311
3
3
  otf_api/exceptions.py,sha256=b6ZdH1dtYyUfXSupdVGGni6d66qqhzD0SGzyuty89gM,2174
4
4
  otf_api/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -8,7 +8,7 @@ otf_api/api/api.py,sha256=yda8RObOMd_lBWbqlAAUZ3dTwGhdEYsfGQJDiphp6Eo,2633
8
8
  otf_api/api/client.py,sha256=o533H-nYweRcosBEYmm3U-7ivkpGDF7jElM9iIhK7E8,8157
9
9
  otf_api/api/utils.py,sha256=mNDUrz6d8b8KqTaUr5fGGGejy6bq9HHLs9LS8ibbfW4,9926
10
10
  otf_api/api/bookings/__init__.py,sha256=ocHSZXV4nnkZhjpjBX76iKHCQ21_ZL5hV4YKgUR0Wwg,62
11
- otf_api/api/bookings/booking_api.py,sha256=deemLK0mrByWm-EPOK1uTYg4XmSbUyH8iJ8V7zTU0Vg,22103
11
+ otf_api/api/bookings/booking_api.py,sha256=VdEX5WF3TIV5V_1n2DclBPqxhXQysNqyxJxeR6c05UM,22124
12
12
  otf_api/api/bookings/booking_client.py,sha256=qYaEomexGWP2N_WdWePMN7BR8aIKEpO71g5J0KaVfAc,4244
13
13
  otf_api/api/members/__init__.py,sha256=6mkeMiATRsNQTYQ37P7k6SWf9RZ9T5QY9-_r1sS1-vY,59
14
14
  otf_api/api/members/member_api.py,sha256=5FAPbRN_Dv3mLC1AmxcErqF1d1ypL5zVEn1u7gDbTZA,7232
@@ -17,7 +17,7 @@ otf_api/api/studios/__init__.py,sha256=vPir509hQOJL7uJ4yBCOHgooXVnXs6N5RlWs1tN54
17
17
  otf_api/api/studios/studio_api.py,sha256=sn1jBebe4u-wE1VkHp2W96beUOFwHdiGzVSmnGNPZjg,6813
18
18
  otf_api/api/studios/studio_client.py,sha256=KWc4CF-2387WDUFYpMtIUm3KyPj1JdelCn7RH9L1FBI,4707
19
19
  otf_api/api/workouts/__init__.py,sha256=GPb2cEsAxoaiJIP8Finrk9x9vUeL9NXA9iz2eya9HYk,62
20
- otf_api/api/workouts/workout_api.py,sha256=S1WBzFu42MiFFvfvFxIBfR5B7mb0XBnmQ5WrspBGRcg,13211
20
+ otf_api/api/workouts/workout_api.py,sha256=6h-ErOOfGRcQ2a3NaOyvbCYfWuHCteugaqNWQwZ7UHY,13374
21
21
  otf_api/api/workouts/workout_client.py,sha256=MvEWbhPXywpQMSdsBSGCYBIR65TJjdqgb7T0Bc8H8D0,6762
22
22
  otf_api/auth/__init__.py,sha256=uTvFTNQVvfogTN_-4D3bRSundAf2enUJ5ji6PwO0xm8,104
23
23
  otf_api/auth/auth.py,sha256=67-RXDla3rVm5vmlyPEOqPOF5kecJiEznVmq0gSz3M0,16448
@@ -25,7 +25,7 @@ otf_api/auth/user.py,sha256=OChRG0EhZ63vEtT_Sg3NmXWmOD1vZcILuHhRXlwaG0I,2156
25
25
  otf_api/auth/utils.py,sha256=YBxqg2h59u4V1ij5kgqJDyKh0gtgOlXrSZdpAKSdelY,3954
26
26
  otf_api/models/__init__.py,sha256=P0IjxRUPIfzUI-e3VDMpipJeWr6BlypWAED2ovnZw-w,1545
27
27
  otf_api/models/base.py,sha256=KJlIxl_sRj6f-g5vKYPw4yV6fGDk-fwZ93EO0JGPYMw,202
28
- otf_api/models/mixins.py,sha256=mY9ufoi3QJM5H7KMU9q7grgYuZp85xLs8ie2aLikvi8,4164
28
+ otf_api/models/mixins.py,sha256=R2FvaxieTcJn7BRn_rPuuV84ZyuV0VS4dhIKw7am6R8,4138
29
29
  otf_api/models/bookings/__init__.py,sha256=-EtaVW9qF5dmWvSlkq693vkxc3bX6d7dWOgcnNNfpV4,642
30
30
  otf_api/models/bookings/bookings.py,sha256=YlocSxdOEECxcCsVkEYAXHFE3EmMTUBxXgSFFxskaLk,5681
31
31
  otf_api/models/bookings/bookings_v2.py,sha256=Jd9zh4E3AEWUyxLTISq2j2I_firKCfV5IQzNdkc7iK4,7965
@@ -52,8 +52,8 @@ otf_api/models/workouts/out_of_studio_workout_history.py,sha256=-BKp-MnIp_5-U2KW
52
52
  otf_api/models/workouts/performance_summary.py,sha256=R1p-g1L4XWWEiBYaGtX5JFvoS3Z6bzQrsPIfTQHDqyM,3464
53
53
  otf_api/models/workouts/telemetry.py,sha256=rKsmLbsOVUxUXH439zxxIEWYGTohKNemqrtMamAl5cA,3465
54
54
  otf_api/models/workouts/workout.py,sha256=_KIR9fLI4LgUlS02Q5SNauHd4aOqJI9H4uaFKf-xJOU,4580
55
- otf_api-0.13.1.dist-info/licenses/LICENSE,sha256=UaPT9ynYigC3nX8n22_rC37n-qmTRKLFaHrtUwF9ktE,1071
56
- otf_api-0.13.1.dist-info/METADATA,sha256=ZyByGm1qfAc2AsDXI1XegDTWQKr5xPdx0L93CFQh8X8,2162
57
- otf_api-0.13.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
58
- otf_api-0.13.1.dist-info/top_level.txt,sha256=KAhYg1X2YG0LkTuVRhUV1I_AReNZUVNdEan7cp0pEE4,8
59
- otf_api-0.13.1.dist-info/RECORD,,
55
+ otf_api-0.13.3.dist-info/licenses/LICENSE,sha256=UaPT9ynYigC3nX8n22_rC37n-qmTRKLFaHrtUwF9ktE,1071
56
+ otf_api-0.13.3.dist-info/METADATA,sha256=Eva2xnCgBVJgCW1JppjUDhPZ8N158PCkamrksLyi7Eg,2162
57
+ otf_api-0.13.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
58
+ otf_api-0.13.3.dist-info/top_level.txt,sha256=KAhYg1X2YG0LkTuVRhUV1I_AReNZUVNdEan7cp0pEE4,8
59
+ otf_api-0.13.3.dist-info/RECORD,,