forked from coddingtonbear/python-myfitnesspal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.py
182 lines (136 loc) · 3.54 KB
/
types.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
from __future__ import annotations
from typing import Any, Callable, Dict, List, Optional
from typing_extensions import Literal, TypedDict
class CommandDefinition(TypedDict):
function: Callable
description: str
is_alias: bool
aliases: List[str]
MyfitnesspalUserId = str
class GoalDisplayDict(TypedDict):
id: str
display_type: str
nutrients: List[str]
class UnitPreferenceDict(TypedDict):
energy: str
weight: str
distance: str
height: str
water: str
class DiaryPreferencesDict(TypedDict):
default_foot_view: str
meal_names: List[str]
tracked_nutrients: List[str]
class UnitValueContainer(TypedDict):
unit: str
value: float
class GoalPreferencesDict(TypedDict):
workouts_per_week: int
weekly_workout_duration: int
weekly_exercise_energy: UnitValueContainer
weight_change_goal: UnitValueContainer
weight_goal: UnitValueContainer
diary_goal_display: str
home_goal_display: str
macro_goal_format: str
class LocationPreferencesDict(TypedDict):
time_zone: str
country_code: str
locale: str
postal_code: str
state: str
city: str
IsoDateStr = str
class AdminFlagDict(TypedDict):
status: str
has_changed_username: bool
forgot_password_or_username: bool
warnings: int
strikes: int
revoked_privileges: List
class AccountDict(TypedDict):
created_at: IsoDateStr
updated_at: IsoDateStr
last_login: IsoDateStr
valid_email: bool
registration_source: str
roles: List[str]
admin_flags: AdminFlagDict
class SystemDataDict(TypedDict):
login_streak: int
unseen_notifications: int
Unknown = Any
class UserProfile(TypedDict):
type: str
starting_weight_date: str
starting_weight: UnitValueContainer
main_image_url: str
main_image_id: Optional[Unknown]
birthdate: str
height: UnitValueContainer
first_name: Optional[str]
last_name: Optional[str]
sex: Literal["M", "F"]
activity_factor: str
headline: Optional[str]
about: Optional[str]
why: Optional[str]
inspirations: List
class UserMetadata(TypedDict):
id: MyfitnesspalUserId
username: str
email: str
goal_displays: List[GoalDisplayDict]
unit_preferences: UnitPreferenceDict
diary_preferences: DiaryPreferencesDict
goal_preferences: GoalPreferencesDict
location_preferences: LocationPreferencesDict
account: AccountDict
system_data: SystemDataDict
step_sources: List
profiles: List[UserProfile]
class AuthData(TypedDict):
token_type: str
access_token: str
expires_in: int
refresh_token: str
user_id: MyfitnesspalUserId
NutritionDict = Dict[str, float]
class MealEntry(TypedDict):
name: str
nutrition_information: NutritionDict
class NoteDataDict(TypedDict):
body: str
type: str
date: str
class FoodItemNutritionDict(TypedDict):
calcium: float
carbohydrates: float
cholesterol: float
fat: float
fiber: float
iron: float
monounsaturated_fat: float
polyunsaturated_fat: float
potassium: float
protein: float
saturated_fat: float
sodium: float
sugar: float
trans_fat: float
vitamin_a: float
vitamin_c: float
class ServingSizeDict(TypedDict):
id: str
nutrition_multiplier: float
value: float
unit: str
index: int
class FoodItemDetailsResponse(TypedDict):
description: str
brand_name: Optional[str]
verified: bool
nutrition: FoodItemNutritionDict
calories: float
confirmations: int
serving_sizes: List[ServingSizeDict]