otf-api 0.2.2__py3-none-any.whl → 0.3.0__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 +12 -67
- otf_api/api.py +794 -36
- otf_api/cli/__init__.py +4 -0
- otf_api/cli/_utilities.py +60 -0
- otf_api/cli/app.py +177 -0
- otf_api/cli/bookings.py +231 -0
- otf_api/cli/prompts.py +162 -0
- otf_api/models/__init__.py +4 -8
- otf_api/models/auth.py +18 -12
- otf_api/models/base.py +205 -2
- otf_api/models/responses/__init__.py +6 -14
- otf_api/models/responses/body_composition_list.py +304 -0
- otf_api/models/responses/book_class.py +405 -0
- otf_api/models/responses/bookings.py +211 -37
- otf_api/models/responses/cancel_booking.py +93 -0
- otf_api/models/responses/challenge_tracker_content.py +6 -6
- otf_api/models/responses/challenge_tracker_detail.py +6 -6
- otf_api/models/responses/classes.py +205 -7
- otf_api/models/responses/enums.py +0 -35
- otf_api/models/responses/favorite_studios.py +5 -5
- otf_api/models/responses/latest_agreement.py +2 -2
- otf_api/models/responses/lifetime_stats.py +92 -0
- otf_api/models/responses/member_detail.py +17 -12
- otf_api/models/responses/member_membership.py +2 -2
- otf_api/models/responses/member_purchases.py +9 -9
- otf_api/models/responses/out_of_studio_workout_history.py +4 -4
- otf_api/models/responses/performance_summary_detail.py +1 -1
- otf_api/models/responses/performance_summary_list.py +13 -13
- otf_api/models/responses/studio_detail.py +10 -10
- otf_api/models/responses/studio_services.py +8 -8
- otf_api/models/responses/telemetry.py +6 -6
- otf_api/models/responses/telemetry_hr_history.py +6 -6
- otf_api/models/responses/telemetry_max_hr.py +3 -3
- otf_api/models/responses/total_classes.py +2 -2
- otf_api/models/responses/workouts.py +4 -4
- otf_api-0.3.0.dist-info/METADATA +55 -0
- otf_api-0.3.0.dist-info/RECORD +42 -0
- otf_api-0.3.0.dist-info/entry_points.txt +3 -0
- otf_api/__version__.py +0 -1
- otf_api/classes_api.py +0 -44
- otf_api/member_api.py +0 -380
- otf_api/performance_api.py +0 -54
- otf_api/studios_api.py +0 -96
- otf_api/telemetry_api.py +0 -95
- otf_api-0.2.2.dist-info/METADATA +0 -284
- otf_api-0.2.2.dist-info/RECORD +0 -38
- {otf_api-0.2.2.dist-info → otf_api-0.3.0.dist-info}/AUTHORS.md +0 -0
- {otf_api-0.2.2.dist-info → otf_api-0.3.0.dist-info}/LICENSE +0 -0
- {otf_api-0.2.2.dist-info → otf_api-0.3.0.dist-info}/WHEEL +0 -0
@@ -1,9 +1,9 @@
|
|
1
1
|
from pydantic import Field
|
2
2
|
|
3
|
-
from otf_api.models.base import
|
3
|
+
from otf_api.models.base import OtfItemBase
|
4
4
|
|
5
5
|
|
6
|
-
class ZoneTimeMinutes(
|
6
|
+
class ZoneTimeMinutes(OtfItemBase):
|
7
7
|
gray: int
|
8
8
|
blue: int
|
9
9
|
green: int
|
@@ -11,7 +11,7 @@ class ZoneTimeMinutes(OtfBaseModel):
|
|
11
11
|
red: int
|
12
12
|
|
13
13
|
|
14
|
-
class Details(
|
14
|
+
class Details(OtfItemBase):
|
15
15
|
calories_burned: int
|
16
16
|
splat_points: int
|
17
17
|
step_count: int
|
@@ -19,18 +19,18 @@ class Details(OtfBaseModel):
|
|
19
19
|
zone_time_minutes: ZoneTimeMinutes
|
20
20
|
|
21
21
|
|
22
|
-
class Coach(
|
22
|
+
class Coach(OtfItemBase):
|
23
23
|
image_url: str | None = None
|
24
24
|
first_name: str
|
25
25
|
|
26
26
|
|
27
|
-
class Studio(
|
27
|
+
class Studio(OtfItemBase):
|
28
28
|
id: str
|
29
29
|
license_number: str
|
30
30
|
name: str
|
31
31
|
|
32
32
|
|
33
|
-
class Class(
|
33
|
+
class Class(OtfItemBase):
|
34
34
|
ot_base_class_uuid: str | None = None
|
35
35
|
starts_at_local: str
|
36
36
|
name: str
|
@@ -38,30 +38,30 @@ class Class(OtfBaseModel):
|
|
38
38
|
studio: Studio
|
39
39
|
|
40
40
|
|
41
|
-
class CoachRating(
|
41
|
+
class CoachRating(OtfItemBase):
|
42
42
|
id: str
|
43
43
|
description: str
|
44
44
|
value: int
|
45
45
|
|
46
46
|
|
47
|
-
class ClassRating(
|
47
|
+
class ClassRating(OtfItemBase):
|
48
48
|
id: str
|
49
49
|
description: str
|
50
50
|
value: int
|
51
51
|
|
52
52
|
|
53
|
-
class Ratings(
|
53
|
+
class Ratings(OtfItemBase):
|
54
54
|
coach: CoachRating
|
55
|
-
|
55
|
+
otf_class: ClassRating = Field(..., alias="class")
|
56
56
|
|
57
57
|
|
58
|
-
class PerformanceSummaryEntry(
|
58
|
+
class PerformanceSummaryEntry(OtfItemBase):
|
59
59
|
performance_summary_id: str = Field(..., alias="id")
|
60
60
|
details: Details
|
61
61
|
ratable: bool
|
62
|
-
|
62
|
+
otf_class: Class = Field(..., alias="class")
|
63
63
|
ratings: Ratings | None = None
|
64
64
|
|
65
65
|
|
66
|
-
class PerformanceSummaryList(
|
66
|
+
class PerformanceSummaryList(OtfItemBase):
|
67
67
|
summaries: list[PerformanceSummaryEntry]
|
@@ -2,17 +2,17 @@ from datetime import datetime
|
|
2
2
|
|
3
3
|
from pydantic import Field
|
4
4
|
|
5
|
-
from otf_api.models.base import
|
5
|
+
from otf_api.models.base import OtfItemBase
|
6
6
|
|
7
7
|
|
8
|
-
class Country(
|
8
|
+
class Country(OtfItemBase):
|
9
9
|
country_id: int = Field(..., alias="countryId")
|
10
10
|
country_currency_code: str = Field(..., alias="countryCurrencyCode")
|
11
11
|
country_currency_name: str = Field(..., alias="countryCurrencyName")
|
12
12
|
currency_alphabetic_code: str = Field(..., alias="currencyAlphabeticCode")
|
13
13
|
|
14
14
|
|
15
|
-
class StudioLocation(
|
15
|
+
class StudioLocation(OtfItemBase):
|
16
16
|
physical_address: str = Field(..., alias="physicalAddress")
|
17
17
|
physical_address2: str | None = Field(..., alias="physicalAddress2")
|
18
18
|
physical_city: str = Field(..., alias="physicalCity")
|
@@ -26,32 +26,32 @@ class StudioLocation(OtfBaseModel):
|
|
26
26
|
longitude: float
|
27
27
|
|
28
28
|
|
29
|
-
class Language(
|
29
|
+
class Language(OtfItemBase):
|
30
30
|
language_id: None = Field(..., alias="languageId")
|
31
31
|
language_code: None = Field(..., alias="languageCode")
|
32
32
|
language_name: None = Field(..., alias="languageName")
|
33
33
|
|
34
34
|
|
35
|
-
class StudioLocationLocalized(
|
35
|
+
class StudioLocationLocalized(OtfItemBase):
|
36
36
|
language: Language
|
37
37
|
studio_name: None = Field(..., alias="studioName")
|
38
38
|
studio_address: None = Field(..., alias="studioAddress")
|
39
39
|
|
40
40
|
|
41
|
-
class StudioProfiles(
|
41
|
+
class StudioProfiles(OtfItemBase):
|
42
42
|
is_web: bool = Field(..., alias="isWeb")
|
43
43
|
intro_capacity: int = Field(..., alias="introCapacity")
|
44
44
|
is_crm: bool | None = Field(..., alias="isCrm")
|
45
45
|
|
46
46
|
|
47
|
-
class SocialMediaLink(
|
47
|
+
class SocialMediaLink(OtfItemBase):
|
48
48
|
id: str
|
49
49
|
language_id: str = Field(..., alias="languageId")
|
50
50
|
name: str
|
51
51
|
value: str
|
52
52
|
|
53
53
|
|
54
|
-
class StudioDetail(
|
54
|
+
class StudioDetail(OtfItemBase):
|
55
55
|
studio_id: int = Field(..., alias="studioId")
|
56
56
|
studio_uuid: str = Field(..., alias="studioUUId")
|
57
57
|
mbo_studio_id: int | None = Field(..., alias="mboStudioId")
|
@@ -100,12 +100,12 @@ class StudioDetail(OtfBaseModel):
|
|
100
100
|
social_media_links: list[SocialMediaLink] = Field(..., alias="socialMediaLinks")
|
101
101
|
|
102
102
|
|
103
|
-
class Pagination(
|
103
|
+
class Pagination(OtfItemBase):
|
104
104
|
page_index: int = Field(..., alias="pageIndex")
|
105
105
|
page_size: int = Field(..., alias="pageSize")
|
106
106
|
total_count: int = Field(..., alias="totalCount")
|
107
107
|
total_pages: int = Field(..., alias="totalPages")
|
108
108
|
|
109
109
|
|
110
|
-
class StudioDetailList(
|
110
|
+
class StudioDetailList(OtfItemBase):
|
111
111
|
studios: list[StudioDetail]
|
@@ -2,34 +2,34 @@ from datetime import datetime
|
|
2
2
|
|
3
3
|
from pydantic import Field
|
4
4
|
|
5
|
-
from otf_api.models.base import
|
5
|
+
from otf_api.models.base import OtfItemBase
|
6
6
|
|
7
7
|
|
8
|
-
class Currency(
|
8
|
+
class Currency(OtfItemBase):
|
9
9
|
currency_alphabetic_code: str = Field(..., alias="currencyAlphabeticCode")
|
10
10
|
|
11
11
|
|
12
|
-
class DefaultCurrency(
|
12
|
+
class DefaultCurrency(OtfItemBase):
|
13
13
|
currency_id: int = Field(..., alias="currencyId")
|
14
14
|
currency: Currency
|
15
15
|
|
16
16
|
|
17
|
-
class Country(
|
17
|
+
class Country(OtfItemBase):
|
18
18
|
country_currency_code: str = Field(..., alias="countryCurrencyCode")
|
19
19
|
default_currency: DefaultCurrency = Field(..., alias="defaultCurrency")
|
20
20
|
|
21
21
|
|
22
|
-
class StudioLocation(
|
22
|
+
class StudioLocation(OtfItemBase):
|
23
23
|
studio_location_id: int = Field(..., alias="studioLocationId")
|
24
24
|
country: Country
|
25
25
|
|
26
26
|
|
27
|
-
class Studio(
|
27
|
+
class Studio(OtfItemBase):
|
28
28
|
studio_id: int = Field(..., alias="studioId")
|
29
29
|
studio_location: StudioLocation = Field(..., alias="studioLocation")
|
30
30
|
|
31
31
|
|
32
|
-
class StudioService(
|
32
|
+
class StudioService(OtfItemBase):
|
33
33
|
service_id: int = Field(..., alias="serviceId")
|
34
34
|
service_uuid: str = Field(..., alias="serviceUUId")
|
35
35
|
studio_id: int = Field(..., alias="studioId")
|
@@ -53,5 +53,5 @@ class StudioService(OtfBaseModel):
|
|
53
53
|
studio: Studio
|
54
54
|
|
55
55
|
|
56
|
-
class StudioServiceList(
|
56
|
+
class StudioServiceList(OtfItemBase):
|
57
57
|
data: list[StudioService]
|
@@ -3,15 +3,15 @@ from typing import Any
|
|
3
3
|
|
4
4
|
from pydantic import Field
|
5
5
|
|
6
|
-
from otf_api.models.base import
|
6
|
+
from otf_api.models.base import OtfItemBase
|
7
7
|
|
8
8
|
|
9
|
-
class Zone(
|
9
|
+
class Zone(OtfItemBase):
|
10
10
|
start_bpm: int = Field(..., alias="startBpm")
|
11
11
|
end_bpm: int = Field(..., alias="endBpm")
|
12
12
|
|
13
13
|
|
14
|
-
class Zones(
|
14
|
+
class Zones(OtfItemBase):
|
15
15
|
gray: Zone
|
16
16
|
blue: Zone
|
17
17
|
green: Zone
|
@@ -19,13 +19,13 @@ class Zones(OtfBaseModel):
|
|
19
19
|
red: Zone
|
20
20
|
|
21
21
|
|
22
|
-
class TreadData(
|
22
|
+
class TreadData(OtfItemBase):
|
23
23
|
tread_speed: float = Field(..., alias="treadSpeed")
|
24
24
|
tread_incline: float = Field(..., alias="treadIncline")
|
25
25
|
agg_tread_distance: int = Field(..., alias="aggTreadDistance")
|
26
26
|
|
27
27
|
|
28
|
-
class TelemetryItem(
|
28
|
+
class TelemetryItem(OtfItemBase):
|
29
29
|
relative_timestamp: int = Field(..., alias="relativeTimestamp")
|
30
30
|
hr: int
|
31
31
|
agg_splats: int = Field(..., alias="aggSplats")
|
@@ -38,7 +38,7 @@ class TelemetryItem(OtfBaseModel):
|
|
38
38
|
tread_data: TreadData | None = Field(None, alias="treadData")
|
39
39
|
|
40
40
|
|
41
|
-
class Telemetry(
|
41
|
+
class Telemetry(OtfItemBase):
|
42
42
|
member_uuid: str = Field(..., alias="memberUuid")
|
43
43
|
class_history_uuid: str = Field(..., alias="classHistoryUuid")
|
44
44
|
class_start_time: datetime = Field(..., alias="classStartTime")
|
@@ -1,19 +1,19 @@
|
|
1
1
|
from pydantic import Field
|
2
2
|
|
3
|
-
from otf_api.models.base import
|
3
|
+
from otf_api.models.base import OtfItemBase
|
4
4
|
|
5
5
|
|
6
|
-
class MaxHr(
|
6
|
+
class MaxHr(OtfItemBase):
|
7
7
|
type: str
|
8
8
|
value: int
|
9
9
|
|
10
10
|
|
11
|
-
class Zone(
|
11
|
+
class Zone(OtfItemBase):
|
12
12
|
start_bpm: int = Field(..., alias="startBpm")
|
13
13
|
end_bpm: int = Field(..., alias="endBpm")
|
14
14
|
|
15
15
|
|
16
|
-
class Zones(
|
16
|
+
class Zones(OtfItemBase):
|
17
17
|
gray: Zone
|
18
18
|
blue: Zone
|
19
19
|
green: Zone
|
@@ -21,7 +21,7 @@ class Zones(OtfBaseModel):
|
|
21
21
|
red: Zone
|
22
22
|
|
23
23
|
|
24
|
-
class HistoryItem(
|
24
|
+
class HistoryItem(OtfItemBase):
|
25
25
|
max_hr: MaxHr = Field(..., alias="maxHr")
|
26
26
|
zones: Zones
|
27
27
|
change_from_previous: int = Field(..., alias="changeFromPrevious")
|
@@ -29,6 +29,6 @@ class HistoryItem(OtfBaseModel):
|
|
29
29
|
assigned_at: str = Field(..., alias="assignedAt")
|
30
30
|
|
31
31
|
|
32
|
-
class TelemetryHrHistory(
|
32
|
+
class TelemetryHrHistory(OtfItemBase):
|
33
33
|
member_uuid: str = Field(..., alias="memberUuid")
|
34
34
|
history: list[HistoryItem]
|
@@ -1,13 +1,13 @@
|
|
1
1
|
from pydantic import Field
|
2
2
|
|
3
|
-
from otf_api.models.base import
|
3
|
+
from otf_api.models.base import OtfItemBase
|
4
4
|
|
5
5
|
|
6
|
-
class MaxHr(
|
6
|
+
class MaxHr(OtfItemBase):
|
7
7
|
type: str
|
8
8
|
value: int
|
9
9
|
|
10
10
|
|
11
|
-
class TelemetryMaxHr(
|
11
|
+
class TelemetryMaxHr(OtfItemBase):
|
12
12
|
member_uuid: str = Field(..., alias="memberUuid")
|
13
13
|
max_hr: MaxHr = Field(..., alias="maxHr")
|
@@ -1,8 +1,8 @@
|
|
1
1
|
from pydantic import Field
|
2
2
|
|
3
|
-
from otf_api.models.base import
|
3
|
+
from otf_api.models.base import OtfItemBase
|
4
4
|
|
5
5
|
|
6
|
-
class TotalClasses(
|
6
|
+
class TotalClasses(OtfItemBase):
|
7
7
|
total_in_studio_classes_attended: int = Field(..., alias="totalInStudioClassesAttended")
|
8
8
|
total_otlive_classes_attended: int = Field(..., alias="totalOtliveClassesAttended")
|
@@ -4,16 +4,16 @@ from typing import Any
|
|
4
4
|
|
5
5
|
from pydantic import Field, PrivateAttr
|
6
6
|
|
7
|
-
from otf_api.models.base import
|
7
|
+
from otf_api.models.base import OtfItemBase
|
8
8
|
|
9
9
|
|
10
|
-
class WorkoutType(
|
10
|
+
class WorkoutType(OtfItemBase):
|
11
11
|
id: int
|
12
12
|
display_name: str = Field(..., alias="displayName")
|
13
13
|
icon: str
|
14
14
|
|
15
15
|
|
16
|
-
class Workout(
|
16
|
+
class Workout(OtfItemBase):
|
17
17
|
studio_number: str = Field(..., alias="studioNumber")
|
18
18
|
studio_name: str = Field(..., alias="studioName")
|
19
19
|
class_type: str = Field(..., alias="classType")
|
@@ -70,7 +70,7 @@ class Workout(OtfBaseModel):
|
|
70
70
|
self._minute_by_minute_raw = data.get("minuteByMinuteHr")
|
71
71
|
|
72
72
|
|
73
|
-
class WorkoutList(
|
73
|
+
class WorkoutList(OtfItemBase):
|
74
74
|
workouts: list[Workout]
|
75
75
|
|
76
76
|
@property
|
@@ -0,0 +1,55 @@
|
|
1
|
+
Metadata-Version: 2.1
|
2
|
+
Name: otf-api
|
3
|
+
Version: 0.3.0
|
4
|
+
Summary: Python OrangeTheory Fitness API Client
|
5
|
+
License: MIT
|
6
|
+
Author: Jessica Smith
|
7
|
+
Author-email: j.smith.git1@gmail.com
|
8
|
+
Requires-Python: >=3.10,<4.0
|
9
|
+
Classifier: Development Status :: 4 - Beta
|
10
|
+
Classifier: Intended Audience :: Developers
|
11
|
+
Classifier: License :: OSI Approved :: MIT License
|
12
|
+
Classifier: Operating System :: OS Independent
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
14
|
+
Classifier: Programming Language :: Python :: 3.10
|
15
|
+
Classifier: Programming Language :: Python :: 3.11
|
16
|
+
Classifier: Programming Language :: Python :: 3.12
|
17
|
+
Classifier: Topic :: Internet :: WWW/HTTP
|
18
|
+
Classifier: Topic :: Software Development :: Libraries
|
19
|
+
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
|
20
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
21
|
+
Requires-Dist: aiohttp (==3.9.5)
|
22
|
+
Requires-Dist: humanize (>=4.9.0,<5.0.0)
|
23
|
+
Requires-Dist: inflection (==0.5.*)
|
24
|
+
Requires-Dist: loguru (==0.7.2)
|
25
|
+
Requires-Dist: pendulum[cli] (>=3.0.0,<4.0.0)
|
26
|
+
Requires-Dist: pint (==0.24.*)
|
27
|
+
Requires-Dist: pycognito (==2024.5.1)
|
28
|
+
Requires-Dist: pydantic (==2.7.3)
|
29
|
+
Requires-Dist: python-box (>=7.2.0,<8.0.0)
|
30
|
+
Requires-Dist: readchar[cli] (>=4.1.0,<5.0.0)
|
31
|
+
Requires-Dist: typer[cli] (>=0.12.3,<0.13.0)
|
32
|
+
Project-URL: Documentation, https://otf-api.readthedocs.io/en/stable/
|
33
|
+
Description-Content-Type: text/markdown
|
34
|
+
|
35
|
+
Simple API client for interacting with the OrangeTheory Fitness APIs.
|
36
|
+
|
37
|
+
|
38
|
+
This library allows access to the OrangeTheory API to retrieve workouts and performance data, class schedules, studio information, and bookings. It is a work in progress, currently only allowing access to GET calls, but my goal is to expand it to include POST, PUT, and DELETE calls as well.
|
39
|
+
|
40
|
+
## Installation
|
41
|
+
```bash
|
42
|
+
pip install otf-api
|
43
|
+
```
|
44
|
+
|
45
|
+
## Overview
|
46
|
+
|
47
|
+
To use the API, you need to create an instance of the `Api` class, providing your email address and password. This will authenticate you with the API and allow you to make requests. When the `Api` object is created it automatically grabs your member details and home studio, to simplify the process of making requests.
|
48
|
+
|
49
|
+
|
50
|
+
See the [examples](./examples) for more information on how to use the API.
|
51
|
+
|
52
|
+
|
53
|
+
Disclaimer:
|
54
|
+
This project is in no way affiliated with OrangeTheory Fitness.
|
55
|
+
|
@@ -0,0 +1,42 @@
|
|
1
|
+
otf_api/__init__.py,sha256=TWtPFBlCS-SBoVXJ5VOR3o_IFWXDHItwKLuvpUpR5WU,238
|
2
|
+
otf_api/api.py,sha256=41sJ6gIvqKnt3jyrqtbPYDuWGcQzmAtOBwiobBWGwKQ,35714
|
3
|
+
otf_api/cli/__init__.py,sha256=WI-882LPH7Tj_ygDHqE5ehsas_u7m3ulsplS9vXKByk,151
|
4
|
+
otf_api/cli/_utilities.py,sha256=epjEO9S6ag4HgJLXlTpCQXfdVQkqGWyNavp7DjwPL78,1753
|
5
|
+
otf_api/cli/app.py,sha256=CGEjaDZW32jWpCAd-afyXNvuNfmT25Ts9HrXKvp5Mf0,6621
|
6
|
+
otf_api/cli/bookings.py,sha256=yXednsIrpgfa8m26S-LXVDIEB8zCfj9J9osdz5c6Kko,8161
|
7
|
+
otf_api/cli/prompts.py,sha256=iyodQXVa5v9VsrMxw0ob1okGRBDbWCSxhrNEylsOTEQ,5358
|
8
|
+
otf_api/models/__init__.py,sha256=zewymgFsv81_s43hl6dPbFkACT17A2dTSY-nXoBk-Qg,1269
|
9
|
+
otf_api/models/auth.py,sha256=DyFManp5RlfQinA0rWG_PjBZXrn2TpSM1-PJ630lamo,4073
|
10
|
+
otf_api/models/base.py,sha256=oTDxyliK64GyTNx1bGTd-b9dfVn0r3YPpSycs2qEuIw,7285
|
11
|
+
otf_api/models/responses/__init__.py,sha256=mhusNSeDyUqW9ki-HahX6xkmLud_9ighPS6yBX7T0k0,1753
|
12
|
+
otf_api/models/responses/body_composition_list.py,sha256=RTC5bQpmMDUKqFl0nGFExdDxfnbOAGoBLWunjpOym80,12193
|
13
|
+
otf_api/models/responses/book_class.py,sha256=bWURKEjLZWPzwu3HNP2zUmHWo7q7h6_z43a9KTST0Ec,15413
|
14
|
+
otf_api/models/responses/bookings.py,sha256=0oQxdKTK-k30GVDKiVxTh0vvPTbrw78sqpQpYL7JnJU,11058
|
15
|
+
otf_api/models/responses/cancel_booking.py,sha256=dmC5OP97Dy4qYT0l1KHYIitqSCo6M6Yqa0QztjgG_xQ,3859
|
16
|
+
otf_api/models/responses/challenge_tracker_content.py,sha256=KKpSWyyg3viN0vf1Sg2zTMlMZExLe3I6wowmUPWvRCA,1423
|
17
|
+
otf_api/models/responses/challenge_tracker_detail.py,sha256=o0y_ETfHmR1QhoOmvd83P6lfMZUPIwPlnS1V_po0dkE,3048
|
18
|
+
otf_api/models/responses/classes.py,sha256=wmFMcFT-VLqOFB65pApffNPH6VFS150CEKHMq2MblI4,7090
|
19
|
+
otf_api/models/responses/enums.py,sha256=Au8XhD-4T8ljiueUykFDc6Qz7kOoTlJ_kiDEx7nLVLM,1191
|
20
|
+
otf_api/models/responses/favorite_studios.py,sha256=C5JSyiNijm6HQEBVrV9vPfZexSWQ1IlN0E3Ag0GeP_0,4982
|
21
|
+
otf_api/models/responses/latest_agreement.py,sha256=aE8hbWE4Pgguw4Itah7a1SqwOLpJ6t9oODFwLQ8Wzo0,774
|
22
|
+
otf_api/models/responses/lifetime_stats.py,sha256=3nWjXJoIcTV_R-Q-3SXo63Uj2xjkFtNXmzj_jPcZPyo,3339
|
23
|
+
otf_api/models/responses/member_detail.py,sha256=WG_GjS_7mZQ72d5rgu7e1dc3e4fVaR5HRlxFtbJfct8,6024
|
24
|
+
otf_api/models/responses/member_membership.py,sha256=_z301T9DrdQW9vIgnx_LeZmkRhvMVhkxrn_v6DDfCUk,995
|
25
|
+
otf_api/models/responses/member_purchases.py,sha256=JoTk3hYjsq4rXogVivZxeFaM-j3gIChmIAGVldOU7rE,6085
|
26
|
+
otf_api/models/responses/out_of_studio_workout_history.py,sha256=FwdnmTgFrMtQ8PngsmCv3UroWj3kDnQg6KfGLievoaU,1709
|
27
|
+
otf_api/models/responses/performance_summary_detail.py,sha256=H5yWxGShR4uiXvY2OaniENburTGM7DKQjN7gvF3MG6g,1585
|
28
|
+
otf_api/models/responses/performance_summary_list.py,sha256=1cbRX4bnLWwy6iYT6NmJXaT2AdZKGJvQMezkvcGLO58,1240
|
29
|
+
otf_api/models/responses/studio_detail.py,sha256=CJBCsi4SMs_W5nrWE4hfCs1ugJ5t7GrH80hTv7Ie3eg,5007
|
30
|
+
otf_api/models/responses/studio_services.py,sha256=mFDClPtU0HCk5fb19gjGKpt2F8n8kto7sj1pE_l4RdQ,1836
|
31
|
+
otf_api/models/responses/telemetry.py,sha256=8dl8FKLeyb6jtqsZT7XD4JzXBMLlami448-Jt0tFbSY,1663
|
32
|
+
otf_api/models/responses/telemetry_hr_history.py,sha256=vDcLb4wTHVBw8O0mGblUujHfJegkflOCWW-bnTXNCI0,763
|
33
|
+
otf_api/models/responses/telemetry_max_hr.py,sha256=xKxH0fIlOqFyZv8UW98XsxF-GMoIs9gnCTAbu88ZQtg,266
|
34
|
+
otf_api/models/responses/total_classes.py,sha256=WrKkWbq0eK8J0RC4qhZ5kmXnv_ZTDbyzsoRm7XKGlss,288
|
35
|
+
otf_api/models/responses/workouts.py,sha256=4r6wQVY-yUsI83JYBpSCYhd7I5u-5OLvy1Vd1_gra88,3177
|
36
|
+
otf_api/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
37
|
+
otf_api-0.3.0.dist-info/AUTHORS.md,sha256=FcNWMxpe8KDuTq4Qau0SUXsabQwGs9TGnMp1WkXRnj8,123
|
38
|
+
otf_api-0.3.0.dist-info/LICENSE,sha256=UaPT9ynYigC3nX8n22_rC37n-qmTRKLFaHrtUwF9ktE,1071
|
39
|
+
otf_api-0.3.0.dist-info/METADATA,sha256=IZh9vTuZTckAY8AsAGmmF0eQWE5yaiHG2C2yPKM_nAE,2275
|
40
|
+
otf_api-0.3.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
41
|
+
otf_api-0.3.0.dist-info/entry_points.txt,sha256=V2jhhfsUo3DeF0CA9HmKrMnvSoOldn9ShIzbApbeHTY,44
|
42
|
+
otf_api-0.3.0.dist-info/RECORD,,
|
otf_api/__version__.py
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
__version__ = "0.2.2"
|
otf_api/classes_api.py
DELETED
@@ -1,44 +0,0 @@
|
|
1
|
-
import typing
|
2
|
-
|
3
|
-
from otf_api.models.responses.classes import OtfClassList
|
4
|
-
|
5
|
-
if typing.TYPE_CHECKING:
|
6
|
-
from otf_api import Api
|
7
|
-
|
8
|
-
|
9
|
-
class ClassesApi:
|
10
|
-
def __init__(self, api: "Api"):
|
11
|
-
self._api = api
|
12
|
-
self.logger = api.logger
|
13
|
-
|
14
|
-
# simplify access to member_id and member_uuid
|
15
|
-
self._member_id = self._api.user.member_id
|
16
|
-
self._member_uuid = self._api.user.member_uuid
|
17
|
-
|
18
|
-
async def get_classes(
|
19
|
-
self, studio_uuids: list[str] | None = None, include_home_studio: bool = True
|
20
|
-
) -> OtfClassList:
|
21
|
-
"""Get the classes for the user.
|
22
|
-
|
23
|
-
Returns a list of classes that are available for the user, based on the studio UUIDs provided. If no studio
|
24
|
-
UUIDs are provided, it will default to the user's home studio.
|
25
|
-
|
26
|
-
Args:
|
27
|
-
studio_uuids (list[str] | None): The studio UUIDs to get the classes for. Default is None, which will\
|
28
|
-
default to the user's home studio only.
|
29
|
-
include_home_studio (bool): Whether to include the home studio in the classes. Default is True.
|
30
|
-
|
31
|
-
Returns:
|
32
|
-
OtfClassList: The classes for the user.
|
33
|
-
"""
|
34
|
-
|
35
|
-
if not studio_uuids:
|
36
|
-
studio_uuids = [self._api.home_studio.studio_uuid]
|
37
|
-
elif include_home_studio and self._api.home_studio.studio_uuid not in studio_uuids:
|
38
|
-
studio_uuids.append(self._api.home_studio.studio_uuid)
|
39
|
-
|
40
|
-
path = "/v1/classes"
|
41
|
-
|
42
|
-
params = {"studio_ids": studio_uuids}
|
43
|
-
res = await self._api._classes_request("GET", path, params=params)
|
44
|
-
return OtfClassList(classes=res["items"])
|