Habiticalib 0.2.0a1__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.
- habiticalib/__init__.py +32 -2
- habiticalib/const.py +1 -1
- habiticalib/lib.py +84 -17
- habiticalib/types.py +401 -9
- {habiticalib-0.2.0a1.dist-info → habiticalib-0.3.0.dist-info}/METADATA +2 -1
- habiticalib-0.3.0.dist-info/RECORD +11 -0
- habiticalib-0.2.0a1.dist-info/RECORD +0 -11
- {habiticalib-0.2.0a1.dist-info → habiticalib-0.3.0.dist-info}/WHEEL +0 -0
- {habiticalib-0.2.0a1.dist-info → habiticalib-0.3.0.dist-info}/licenses/LICENSE +0 -0
habiticalib/__init__.py
CHANGED
@@ -8,16 +8,21 @@ from .exceptions import (
|
|
8
8
|
NotFoundError,
|
9
9
|
TooManyRequestsError,
|
10
10
|
)
|
11
|
+
from .helpers import deserialize_task
|
11
12
|
from .lib import Habitica
|
12
13
|
from .types import (
|
13
14
|
Attributes,
|
15
|
+
ChangeClassData,
|
16
|
+
ContentData,
|
14
17
|
Direction,
|
15
18
|
Frequency,
|
16
19
|
HabiticaClass,
|
17
20
|
HabiticaClassSystemResponse,
|
21
|
+
HabiticaContentResponse,
|
18
22
|
HabiticaErrorResponse,
|
19
23
|
HabiticaGroupMembersResponse,
|
20
24
|
HabiticaLoginResponse,
|
25
|
+
HabiticaQuestResponse,
|
21
26
|
HabiticaResponse,
|
22
27
|
HabiticaScoreResponse,
|
23
28
|
HabiticaSleepResponse,
|
@@ -27,31 +32,44 @@ from .types import (
|
|
27
32
|
HabiticaTaskOrderResponse,
|
28
33
|
HabiticaTaskResponse,
|
29
34
|
HabiticaTasksResponse,
|
35
|
+
HabiticaUserAnonymized,
|
30
36
|
HabiticaUserExport,
|
31
37
|
HabiticaUserResponse,
|
32
38
|
Language,
|
39
|
+
LoginData,
|
40
|
+
QuestData,
|
41
|
+
ScoreData,
|
33
42
|
Skill,
|
43
|
+
StatsUser,
|
44
|
+
TagsUser,
|
34
45
|
Task,
|
46
|
+
TaskData,
|
35
47
|
TaskFilter,
|
48
|
+
TaskPriority,
|
36
49
|
TaskType,
|
50
|
+
UserAnonymizedData,
|
51
|
+
UserData,
|
37
52
|
UserStyles,
|
38
53
|
)
|
39
54
|
|
40
55
|
__all__ = [
|
41
|
-
"__version__",
|
42
56
|
"ASSETS_URL",
|
57
|
+
"DEFAULT_URL",
|
43
58
|
"Attributes",
|
44
59
|
"BadRequestError",
|
45
|
-
"
|
60
|
+
"ChangeClassData",
|
61
|
+
"ContentData",
|
46
62
|
"Direction",
|
47
63
|
"Frequency",
|
48
64
|
"Habitica",
|
49
65
|
"HabiticaClass",
|
50
66
|
"HabiticaClassSystemResponse",
|
67
|
+
"HabiticaContentResponse",
|
51
68
|
"HabiticaErrorResponse",
|
52
69
|
"HabiticaException",
|
53
70
|
"HabiticaGroupMembersResponse",
|
54
71
|
"HabiticaLoginResponse",
|
72
|
+
"HabiticaQuestResponse",
|
55
73
|
"HabiticaResponse",
|
56
74
|
"HabiticaScoreResponse",
|
57
75
|
"HabiticaSleepResponse",
|
@@ -61,15 +79,27 @@ __all__ = [
|
|
61
79
|
"HabiticaTaskOrderResponse",
|
62
80
|
"HabiticaTaskResponse",
|
63
81
|
"HabiticaTasksResponse",
|
82
|
+
"HabiticaUserAnonymized",
|
64
83
|
"HabiticaUserExport",
|
65
84
|
"HabiticaUserResponse",
|
66
85
|
"Language",
|
86
|
+
"LoginData",
|
67
87
|
"NotAuthorizedError",
|
68
88
|
"NotFoundError",
|
89
|
+
"QuestData",
|
90
|
+
"ScoreData",
|
69
91
|
"Skill",
|
92
|
+
"StatsUser",
|
93
|
+
"TagsUser",
|
70
94
|
"Task",
|
95
|
+
"TaskData",
|
71
96
|
"TaskFilter",
|
97
|
+
"TaskPriority",
|
72
98
|
"TaskType",
|
73
99
|
"TooManyRequestsError",
|
100
|
+
"UserAnonymizedData",
|
101
|
+
"UserData",
|
74
102
|
"UserStyles",
|
103
|
+
"__version__",
|
104
|
+
"deserialize_task",
|
75
105
|
]
|
habiticalib/const.py
CHANGED
habiticalib/lib.py
CHANGED
@@ -6,9 +6,10 @@ import asyncio
|
|
6
6
|
from http import HTTPStatus
|
7
7
|
from io import BytesIO
|
8
8
|
import logging
|
9
|
-
from typing import IO, TYPE_CHECKING, Self
|
9
|
+
from typing import IO, TYPE_CHECKING, Any, Self
|
10
10
|
|
11
11
|
from aiohttp import ClientError, ClientResponseError, ClientSession
|
12
|
+
from habitipy.aio import HabitipyAsync # type: ignore[import-untyped]
|
12
13
|
from PIL import Image
|
13
14
|
from yarl import URL
|
14
15
|
|
@@ -31,6 +32,7 @@ from .types import (
|
|
31
32
|
Direction,
|
32
33
|
HabiticaClass,
|
33
34
|
HabiticaClassSystemResponse,
|
35
|
+
HabiticaContentResponse,
|
34
36
|
HabiticaErrorResponse,
|
35
37
|
HabiticaGroupMembersResponse,
|
36
38
|
HabiticaLoginResponse,
|
@@ -44,6 +46,7 @@ from .types import (
|
|
44
46
|
HabiticaTaskOrderResponse,
|
45
47
|
HabiticaTaskResponse,
|
46
48
|
HabiticaTasksResponse,
|
49
|
+
HabiticaUserAnonymized,
|
47
50
|
HabiticaUserExport,
|
48
51
|
HabiticaUserResponse,
|
49
52
|
Language,
|
@@ -205,10 +208,7 @@ class Habitica:
|
|
205
208
|
return response
|
206
209
|
|
207
210
|
async def get_user(
|
208
|
-
self,
|
209
|
-
user_fields: str | list[str] | None = None,
|
210
|
-
*,
|
211
|
-
anonymized: bool = False,
|
211
|
+
self, user_fields: str | list[str] | None = None
|
212
212
|
) -> HabiticaUserResponse:
|
213
213
|
"""Get the authenticated user's profile.
|
214
214
|
|
@@ -218,11 +218,6 @@ class Habitica:
|
|
218
218
|
A string or a list of fields to include in the response.
|
219
219
|
If provided as a list, the fields will be joined with commas.
|
220
220
|
If None, the full user profile document is returned. Default is None.
|
221
|
-
anonymized : bool
|
222
|
-
When True, returns the user's data without: Authentication information,
|
223
|
-
New Messages/Invitations/Inbox, Profile, Purchased information,
|
224
|
-
Contributor information, Special items, Webhooks, Notifications.
|
225
|
-
(default is False)
|
226
221
|
|
227
222
|
Returns
|
228
223
|
-------
|
@@ -252,25 +247,67 @@ class Habitica:
|
|
252
247
|
|
253
248
|
if user_fields:
|
254
249
|
params = {"userFields": join_fields(user_fields)}
|
255
|
-
if anonymized:
|
256
|
-
url = url / "anonymized"
|
257
250
|
|
258
251
|
return HabiticaUserResponse.from_json(
|
259
252
|
await self._request("get", url=url, params=params),
|
260
253
|
)
|
261
254
|
|
255
|
+
async def get_user_anonymized(
|
256
|
+
self,
|
257
|
+
) -> HabiticaUserAnonymized:
|
258
|
+
"""Get the authenticated user's anonymized profile.
|
259
|
+
|
260
|
+
This method retrieves the user's profile data while excluding sensitive
|
261
|
+
and personally identifiable information such as authentication details,
|
262
|
+
profile data, purchased items, contributor information, special items,
|
263
|
+
webhooks, and notifications.
|
264
|
+
|
265
|
+
Returns
|
266
|
+
-------
|
267
|
+
HabiticaUserAnonymized
|
268
|
+
A response object containing the anonymized user profile data.
|
269
|
+
|
270
|
+
|
271
|
+
Raises
|
272
|
+
------
|
273
|
+
NotAuthorizedError
|
274
|
+
If the API request is unauthorized (HTTP 401).
|
275
|
+
aiohttp.ClientResponseError
|
276
|
+
For other HTTP-related errors raised by aiohttp, such as HTTP 400 or 500.
|
277
|
+
aiohttp.ClientConnectionError
|
278
|
+
If the connection to the API fails.
|
279
|
+
aiohttp.ClientError
|
280
|
+
For any other exceptions raised by aiohttp during the request.
|
281
|
+
TimeoutError
|
282
|
+
If the connection times out.
|
283
|
+
|
284
|
+
Examples
|
285
|
+
--------
|
286
|
+
>>> response = await habitica.get_user_anonymized()
|
287
|
+
>>> response.data.user # Access the anonymized user data
|
288
|
+
>>> response.data.tasks # Access the user's anonymized tasks
|
289
|
+
"""
|
290
|
+
url = self.url / "api/v3/user"
|
291
|
+
|
292
|
+
url = url / "anonymized"
|
293
|
+
|
294
|
+
return HabiticaUserAnonymized.from_json(
|
295
|
+
await self._request("get", url=url),
|
296
|
+
)
|
297
|
+
|
262
298
|
async def get_tasks(
|
263
299
|
self,
|
264
300
|
task_type: TaskFilter | None = None,
|
265
301
|
due_date: datetime | None = None,
|
266
|
-
) ->
|
302
|
+
) -> HabiticaTasksResponse:
|
267
303
|
"""Get the authenticated user's tasks.
|
268
304
|
|
269
305
|
Parameters
|
270
306
|
----------
|
271
307
|
task_type : TaskFilter | None
|
272
308
|
The type of task to retrieve, defined in TaskFilter enum.
|
273
|
-
If `None`, all task types will be retrieved
|
309
|
+
If `None`, all task types will be retrieved except completed to-dos
|
310
|
+
(default is None).
|
274
311
|
|
275
312
|
due_date : datetime | None
|
276
313
|
Optional date to use for computing the nextDue field for each returned task.
|
@@ -458,7 +495,7 @@ class Habitica:
|
|
458
495
|
Returns
|
459
496
|
-------
|
460
497
|
HabiticaTaskResponse
|
461
|
-
A response
|
498
|
+
A response containing an empty data object.
|
462
499
|
|
463
500
|
Raises
|
464
501
|
------
|
@@ -562,7 +599,7 @@ class Habitica:
|
|
562
599
|
async def get_content(
|
563
600
|
self,
|
564
601
|
language: Language | None = None,
|
565
|
-
) ->
|
602
|
+
) -> HabiticaContentResponse:
|
566
603
|
"""
|
567
604
|
Fetch game content from the Habitica API.
|
568
605
|
|
@@ -604,7 +641,7 @@ class Habitica:
|
|
604
641
|
if language:
|
605
642
|
params.update({"language": language.value})
|
606
643
|
|
607
|
-
return
|
644
|
+
return HabiticaContentResponse.from_json(
|
608
645
|
await self._request("get", url=url, params=params),
|
609
646
|
)
|
610
647
|
|
@@ -1996,3 +2033,33 @@ class Habitica:
|
|
1996
2033
|
image.save(fp, fmt)
|
1997
2034
|
|
1998
2035
|
return user_styles
|
2036
|
+
|
2037
|
+
async def habitipy(self) -> HabitipyAsync:
|
2038
|
+
"""Create a Habitipy instance."""
|
2039
|
+
|
2040
|
+
_session = self._session
|
2041
|
+
_headers = self._headers
|
2042
|
+
loop = asyncio.get_running_loop()
|
2043
|
+
|
2044
|
+
class HAHabitipyAsync(HabitipyAsync):
|
2045
|
+
"""Closure API class to hold session."""
|
2046
|
+
|
2047
|
+
def __call__(self, **kwargs) -> Any:
|
2048
|
+
"""Pass session to habitipy."""
|
2049
|
+
return super().__call__(_session, **kwargs)
|
2050
|
+
|
2051
|
+
def _make_headers(self) -> dict[str, str]:
|
2052
|
+
"""Inject headers."""
|
2053
|
+
headers = super()._make_headers()
|
2054
|
+
headers.update(_headers)
|
2055
|
+
return headers
|
2056
|
+
|
2057
|
+
return await loop.run_in_executor(
|
2058
|
+
None,
|
2059
|
+
HAHabitipyAsync,
|
2060
|
+
{
|
2061
|
+
"url": str(self.url),
|
2062
|
+
"login": self._headers.get("X-API-USER"),
|
2063
|
+
"password": self._headers.get("X-API-KEY"),
|
2064
|
+
}, # type: ignore[var-annotated]
|
2065
|
+
)
|
habiticalib/types.py
CHANGED
@@ -8,7 +8,7 @@ import datetime as dt
|
|
8
8
|
from datetime import UTC, datetime
|
9
9
|
from enum import Enum, StrEnum
|
10
10
|
from typing import Any, NotRequired, TypedDict
|
11
|
-
from uuid import UUID
|
11
|
+
from uuid import UUID
|
12
12
|
|
13
13
|
from mashumaro import field_options
|
14
14
|
from mashumaro.mixins.orjson import DataClassORJSONMixin
|
@@ -591,7 +591,7 @@ class PreferencesUser:
|
|
591
591
|
webhooks: dict = field(default_factory=dict)
|
592
592
|
improvementCategories: list[str] = field(default_factory=list)
|
593
593
|
timezoneOffsetAtLastCron: int | None = None
|
594
|
-
language:
|
594
|
+
language: Language | None = None
|
595
595
|
|
596
596
|
|
597
597
|
@dataclass(kw_only=True)
|
@@ -662,13 +662,6 @@ class StatsUser:
|
|
662
662
|
Int: int | None = field(default=None, metadata=field_options(alias="int"))
|
663
663
|
|
664
664
|
|
665
|
-
field(
|
666
|
-
metadata=field_options(
|
667
|
-
deserialize=serialize_datetime,
|
668
|
-
)
|
669
|
-
)
|
670
|
-
|
671
|
-
|
672
665
|
@dataclass(kw_only=True)
|
673
666
|
class TagsUser:
|
674
667
|
"""Tags user data."""
|
@@ -1048,6 +1041,21 @@ class HabiticaUserExport(UserData, DataClassORJSONMixin):
|
|
1048
1041
|
tasks: TasksUserExport = field(default_factory=TasksUserExport)
|
1049
1042
|
|
1050
1043
|
|
1044
|
+
@dataclass
|
1045
|
+
class UserAnonymizedData:
|
1046
|
+
"""Anonymized user data."""
|
1047
|
+
|
1048
|
+
user: UserData = field(default_factory=UserData)
|
1049
|
+
tasks: list[TaskData] = field(default_factory=list)
|
1050
|
+
|
1051
|
+
|
1052
|
+
@dataclass(kw_only=True)
|
1053
|
+
class HabiticaUserAnonymized(DataClassORJSONMixin):
|
1054
|
+
"""Representation of a anonymized user data export."""
|
1055
|
+
|
1056
|
+
data: UserAnonymizedData
|
1057
|
+
|
1058
|
+
|
1051
1059
|
@dataclass(kw_only=True)
|
1052
1060
|
class HabiticaStatsResponse(HabiticaResponse):
|
1053
1061
|
"""Representation of a response containing stats data."""
|
@@ -1255,3 +1263,387 @@ class TaskPriority(Enum):
|
|
1255
1263
|
EASY = 1
|
1256
1264
|
MEDIUM = 1.5
|
1257
1265
|
HARD = 2
|
1266
|
+
|
1267
|
+
|
1268
|
+
@dataclass
|
1269
|
+
class AchievmentContent:
|
1270
|
+
"""Achievment content data."""
|
1271
|
+
|
1272
|
+
icon: str
|
1273
|
+
key: str
|
1274
|
+
titleKey: str | None = None
|
1275
|
+
textKey: str | None = None
|
1276
|
+
singularTitleKey: str | None = None
|
1277
|
+
singularTextKey: str | None = None
|
1278
|
+
pluralTitleKey: str | None = None
|
1279
|
+
pluralTextKey: str | None = None
|
1280
|
+
|
1281
|
+
|
1282
|
+
@dataclass
|
1283
|
+
class AnimalColorAchievementContent:
|
1284
|
+
"""animalColorAchievement content data."""
|
1285
|
+
|
1286
|
+
color: str
|
1287
|
+
petAchievement: str
|
1288
|
+
petNotificationType: str
|
1289
|
+
mountAchievement: str
|
1290
|
+
mountNotificationType: str
|
1291
|
+
|
1292
|
+
|
1293
|
+
@dataclass
|
1294
|
+
class AnimalSetAchievementContent:
|
1295
|
+
"""animalSetAchievements content data."""
|
1296
|
+
|
1297
|
+
Type: str = field(metadata=field_options(alias="type"))
|
1298
|
+
species: list[str]
|
1299
|
+
achievementKey: str
|
1300
|
+
notificationType: str
|
1301
|
+
|
1302
|
+
|
1303
|
+
@dataclass
|
1304
|
+
class StableAchievementContent:
|
1305
|
+
"""stableAchievements content data."""
|
1306
|
+
|
1307
|
+
masterAchievement: str
|
1308
|
+
masterNotificationType: str
|
1309
|
+
|
1310
|
+
|
1311
|
+
@dataclass
|
1312
|
+
class PetSetCompleteAchievsContent:
|
1313
|
+
"""petSetCompleteAchievs content data."""
|
1314
|
+
|
1315
|
+
color: str
|
1316
|
+
petAchievement: str
|
1317
|
+
petNotificationType: str
|
1318
|
+
|
1319
|
+
|
1320
|
+
@dataclass
|
1321
|
+
class QuestBossRage:
|
1322
|
+
"""QuestBossRage content data."""
|
1323
|
+
|
1324
|
+
title: str
|
1325
|
+
description: str
|
1326
|
+
value: float
|
1327
|
+
effect: str | None = None
|
1328
|
+
healing: float | None = None
|
1329
|
+
|
1330
|
+
|
1331
|
+
@dataclass
|
1332
|
+
class QuestBoss:
|
1333
|
+
"""QuestBoss content data."""
|
1334
|
+
|
1335
|
+
name: str
|
1336
|
+
hp: float
|
1337
|
+
Str: float = field(metadata=field_options(alias="str"))
|
1338
|
+
Def: float = field(metadata=field_options(alias="def"))
|
1339
|
+
rage: QuestBossRage | None = None
|
1340
|
+
|
1341
|
+
|
1342
|
+
@dataclass
|
1343
|
+
class QuestItem:
|
1344
|
+
"""QuestItem content data."""
|
1345
|
+
|
1346
|
+
Type: str = field(metadata=field_options(alias="type"))
|
1347
|
+
key: str
|
1348
|
+
text: str
|
1349
|
+
|
1350
|
+
|
1351
|
+
@dataclass
|
1352
|
+
class QuestDrop:
|
1353
|
+
"""QuestDrop content data."""
|
1354
|
+
|
1355
|
+
gp: float
|
1356
|
+
exp: float
|
1357
|
+
items: list[QuestItem] | None = None
|
1358
|
+
|
1359
|
+
|
1360
|
+
@dataclass
|
1361
|
+
class QuestCollect:
|
1362
|
+
"""QuestCollect content data."""
|
1363
|
+
|
1364
|
+
text: str
|
1365
|
+
count: int
|
1366
|
+
|
1367
|
+
|
1368
|
+
@dataclass
|
1369
|
+
class QuestUnlockCondition:
|
1370
|
+
"""QuestUnlockCondition content data."""
|
1371
|
+
|
1372
|
+
condition: str
|
1373
|
+
text: str
|
1374
|
+
|
1375
|
+
|
1376
|
+
@dataclass
|
1377
|
+
class QuestsContent:
|
1378
|
+
"""petSetCompleteAchievs content data."""
|
1379
|
+
|
1380
|
+
text: str
|
1381
|
+
notes: str
|
1382
|
+
|
1383
|
+
completion: str
|
1384
|
+
category: str
|
1385
|
+
|
1386
|
+
drop: QuestDrop
|
1387
|
+
key: str
|
1388
|
+
goldValue: float | None = None
|
1389
|
+
value: float | None = None
|
1390
|
+
previous: str | None = None
|
1391
|
+
prereqQuests: list[str] | None = None
|
1392
|
+
collect: dict[str, QuestCollect] | None = None
|
1393
|
+
unlockCondition: QuestUnlockCondition | None = None
|
1394
|
+
boss: QuestBoss | None = None
|
1395
|
+
group: str | None = None
|
1396
|
+
|
1397
|
+
|
1398
|
+
@dataclass
|
1399
|
+
class ItemListEntry:
|
1400
|
+
"""ItemListEntry content data."""
|
1401
|
+
|
1402
|
+
localeKey: str
|
1403
|
+
isEquipment: bool
|
1404
|
+
|
1405
|
+
|
1406
|
+
@dataclass
|
1407
|
+
class ItemListContent:
|
1408
|
+
"""ItemListContent content data."""
|
1409
|
+
|
1410
|
+
weapon: ItemListEntry
|
1411
|
+
armor: ItemListEntry
|
1412
|
+
head: ItemListEntry
|
1413
|
+
shield: ItemListEntry
|
1414
|
+
back: ItemListEntry
|
1415
|
+
body: ItemListEntry
|
1416
|
+
headAccessory: ItemListEntry
|
1417
|
+
eyewear: ItemListEntry
|
1418
|
+
hatchingPotions: ItemListEntry
|
1419
|
+
premiumHatchingPotions: ItemListEntry
|
1420
|
+
eggs: ItemListEntry
|
1421
|
+
quests: ItemListEntry
|
1422
|
+
food: ItemListEntry
|
1423
|
+
Saddle: ItemListEntry
|
1424
|
+
bundles: ItemListEntry
|
1425
|
+
|
1426
|
+
|
1427
|
+
@dataclass
|
1428
|
+
class GearEntry:
|
1429
|
+
"""GearEntry content data."""
|
1430
|
+
|
1431
|
+
text: str
|
1432
|
+
notes: str
|
1433
|
+
Int: int = field(metadata=field_options(alias="int"))
|
1434
|
+
value: int
|
1435
|
+
Type: str = field(metadata=field_options(alias="type"))
|
1436
|
+
key: str
|
1437
|
+
Set: str = field(metadata=field_options(alias="set"))
|
1438
|
+
klass: str
|
1439
|
+
index: str
|
1440
|
+
Str: int = field(metadata=field_options(alias="str"))
|
1441
|
+
per: int
|
1442
|
+
con: int
|
1443
|
+
|
1444
|
+
|
1445
|
+
@dataclass
|
1446
|
+
class GearClass:
|
1447
|
+
"""GearClass content data."""
|
1448
|
+
|
1449
|
+
base: dict[str, GearEntry] | None = None
|
1450
|
+
warrior: dict[str, GearEntry] | None = None
|
1451
|
+
wizard: dict[str, GearEntry] | None = None
|
1452
|
+
rogue: dict[str, GearEntry] | None = None
|
1453
|
+
special: dict[str, GearEntry] | None = None
|
1454
|
+
armoire: dict[str, GearEntry] | None = None
|
1455
|
+
mystery: dict[str, GearEntry] | None = None
|
1456
|
+
healer: dict[str, GearEntry] | None = None
|
1457
|
+
|
1458
|
+
|
1459
|
+
@dataclass
|
1460
|
+
class GearType:
|
1461
|
+
"""GearType content data."""
|
1462
|
+
|
1463
|
+
weapon: GearClass
|
1464
|
+
armor: GearClass
|
1465
|
+
head: GearClass
|
1466
|
+
shield: GearClass
|
1467
|
+
back: GearClass
|
1468
|
+
body: GearClass
|
1469
|
+
headAccessory: GearClass
|
1470
|
+
eyewear: GearClass
|
1471
|
+
|
1472
|
+
|
1473
|
+
@dataclass
|
1474
|
+
class GearContent:
|
1475
|
+
"""GearContent content data."""
|
1476
|
+
|
1477
|
+
tree: GearType
|
1478
|
+
flat: dict[str, GearEntry]
|
1479
|
+
|
1480
|
+
|
1481
|
+
@dataclass
|
1482
|
+
class SpellEntry:
|
1483
|
+
"""SpellEntry content data."""
|
1484
|
+
|
1485
|
+
text: str
|
1486
|
+
mana: int
|
1487
|
+
target: str
|
1488
|
+
notes: str
|
1489
|
+
key: str
|
1490
|
+
previousPurchase: bool | None = None
|
1491
|
+
limited: bool | None = None
|
1492
|
+
lvl: int | None = None
|
1493
|
+
value: int | None = None
|
1494
|
+
immediateUse: bool | None = None
|
1495
|
+
purchaseType: str | None = None
|
1496
|
+
silent: bool | None = None
|
1497
|
+
|
1498
|
+
|
1499
|
+
@dataclass
|
1500
|
+
class SpellsClass:
|
1501
|
+
"""SpellsClass content data."""
|
1502
|
+
|
1503
|
+
wizard: dict[str, SpellEntry]
|
1504
|
+
warrior: dict[str, SpellEntry]
|
1505
|
+
rogue: dict[str, SpellEntry]
|
1506
|
+
healer: dict[str, SpellEntry]
|
1507
|
+
special: dict[str, SpellEntry]
|
1508
|
+
|
1509
|
+
|
1510
|
+
@dataclass
|
1511
|
+
class CarTypes:
|
1512
|
+
"""CarTypes content data."""
|
1513
|
+
|
1514
|
+
key: str
|
1515
|
+
messageOptions: int
|
1516
|
+
yearRound: bool = False
|
1517
|
+
|
1518
|
+
|
1519
|
+
@dataclass
|
1520
|
+
class SpecialItemEntry:
|
1521
|
+
"""Item content data."""
|
1522
|
+
|
1523
|
+
key: str | None = None
|
1524
|
+
text: str | None = None
|
1525
|
+
notes: str | None = None
|
1526
|
+
immediateUse: bool | None = None
|
1527
|
+
limited: bool | None = None
|
1528
|
+
mana: int | None = None
|
1529
|
+
previousPurchase: bool | None = None
|
1530
|
+
purchaseType: str | None = None
|
1531
|
+
silent: bool | None = None
|
1532
|
+
target: str | None = None
|
1533
|
+
value: int | None = None
|
1534
|
+
|
1535
|
+
|
1536
|
+
@dataclass
|
1537
|
+
class EggEntry:
|
1538
|
+
"""Egg content data."""
|
1539
|
+
|
1540
|
+
text: str | None = None
|
1541
|
+
mountText: str | None = None
|
1542
|
+
adjective: str | None = None
|
1543
|
+
value: int | None = None
|
1544
|
+
key: str | None = None
|
1545
|
+
notes: str | None = None
|
1546
|
+
|
1547
|
+
|
1548
|
+
@dataclass
|
1549
|
+
class HatchingPotionEntry:
|
1550
|
+
"""Hatching potion content data."""
|
1551
|
+
|
1552
|
+
value: int | None = None
|
1553
|
+
key: str | None = None
|
1554
|
+
text: str | None = None
|
1555
|
+
notes: str | None = None
|
1556
|
+
premium: bool | None = None
|
1557
|
+
limited: bool | None = None
|
1558
|
+
_addlNotes: str | None = None
|
1559
|
+
wacky: bool | None = None
|
1560
|
+
|
1561
|
+
|
1562
|
+
@dataclass
|
1563
|
+
class PetEntry:
|
1564
|
+
"""Pet content data."""
|
1565
|
+
|
1566
|
+
key: str | None = None
|
1567
|
+
Type: str | None = field(default=None, metadata=field_options(alias="type"))
|
1568
|
+
potion: str | None = None
|
1569
|
+
egg: str | None = None
|
1570
|
+
text: str | None = None
|
1571
|
+
|
1572
|
+
|
1573
|
+
@dataclass
|
1574
|
+
class InventoryItemEntry:
|
1575
|
+
"""Inventory item content data."""
|
1576
|
+
|
1577
|
+
text: str | None = None
|
1578
|
+
textA: str | None = None
|
1579
|
+
textThe: str | None = None
|
1580
|
+
target: str | None = None
|
1581
|
+
value: int | None = None
|
1582
|
+
key: str | None = None
|
1583
|
+
notes: str | None = None
|
1584
|
+
canDrop: bool | None = None
|
1585
|
+
|
1586
|
+
|
1587
|
+
@dataclass
|
1588
|
+
class ContentData:
|
1589
|
+
"""Content data."""
|
1590
|
+
|
1591
|
+
achievements: dict[str, AchievmentContent]
|
1592
|
+
questSeriesAchievements: dict[str, list[str]]
|
1593
|
+
animalColorAchievements: list[AnimalColorAchievementContent]
|
1594
|
+
animalSetAchievements: dict[str, AnimalSetAchievementContent]
|
1595
|
+
stableAchievements: dict[str, StableAchievementContent]
|
1596
|
+
petSetCompleteAchievs: list[PetSetCompleteAchievsContent]
|
1597
|
+
quests: dict[str, QuestsContent]
|
1598
|
+
questsByLevel: list[QuestsContent]
|
1599
|
+
userCanOwnQuestCategories: list[str]
|
1600
|
+
itemList: ItemListContent
|
1601
|
+
gear: GearContent
|
1602
|
+
spells: SpellsClass
|
1603
|
+
audioThemes: list[str]
|
1604
|
+
# mystery
|
1605
|
+
officialPinnedItems: list
|
1606
|
+
# bundles
|
1607
|
+
# potion
|
1608
|
+
# armoire
|
1609
|
+
# events
|
1610
|
+
# repeatingEvents
|
1611
|
+
classes: list[str]
|
1612
|
+
gearTypes: list[str]
|
1613
|
+
cardTypes: dict[str, CarTypes]
|
1614
|
+
special: dict[str, SpecialItemEntry]
|
1615
|
+
dropEggs: dict[str, EggEntry]
|
1616
|
+
questEggs: dict[str, EggEntry]
|
1617
|
+
eggs: dict[str, EggEntry]
|
1618
|
+
# timeTravelStable
|
1619
|
+
dropHatchingPotions: dict[str, HatchingPotionEntry]
|
1620
|
+
premiumHatchingPotions: dict[str, HatchingPotionEntry]
|
1621
|
+
wackyHatchingPotions: dict[str, HatchingPotionEntry]
|
1622
|
+
hatchingPotions: dict[str, HatchingPotionEntry]
|
1623
|
+
pets: dict[str, bool]
|
1624
|
+
premiumPets: dict[str, bool]
|
1625
|
+
questPets: dict[str, bool]
|
1626
|
+
specialPets: dict[str, str]
|
1627
|
+
wackyPets: dict[str, bool]
|
1628
|
+
petInfo: dict[str, PetEntry]
|
1629
|
+
mounts: dict[str, bool]
|
1630
|
+
premiumMounts: dict[str, bool]
|
1631
|
+
questMounts: dict[str, bool]
|
1632
|
+
specialMounts: dict[str, str]
|
1633
|
+
mountInfo: dict[str, PetEntry]
|
1634
|
+
food: dict[str, InventoryItemEntry]
|
1635
|
+
# appearances
|
1636
|
+
# backgrounds
|
1637
|
+
# backgroundsFlat
|
1638
|
+
# userDefaults
|
1639
|
+
# tasksByCategory
|
1640
|
+
# userDefaultsMobile
|
1641
|
+
# faq
|
1642
|
+
# loginIncentives
|
1643
|
+
|
1644
|
+
|
1645
|
+
@dataclass
|
1646
|
+
class HabiticaContentResponse(HabiticaResponse):
|
1647
|
+
"""Representation of a content response."""
|
1648
|
+
|
1649
|
+
data: ContentData
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: Habiticalib
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.3.0
|
4
4
|
Summary: Asynchronous Python client library for the Habitica API
|
5
5
|
Project-URL: Documentation, https://tr4nt0r.github.io/habiticalib/
|
6
6
|
Project-URL: Source, https://github.com/tr4nt0r/habiticalib
|
@@ -11,6 +11,7 @@ Classifier: Operating System :: OS Independent
|
|
11
11
|
Classifier: Programming Language :: Python :: 3 :: Only
|
12
12
|
Requires-Python: >=3.12
|
13
13
|
Requires-Dist: aiohttp~=3.9
|
14
|
+
Requires-Dist: habitipy~=0.3.3
|
14
15
|
Requires-Dist: mashumaro~=3.13
|
15
16
|
Requires-Dist: orjson~=3.10
|
16
17
|
Requires-Dist: pillow~=11.0
|
@@ -0,0 +1,11 @@
|
|
1
|
+
habiticalib/__init__.py,sha256=NoFYNqRKuLiMwXWCWdxxkxnubmUplxCb3Ct0kQy0ZYo,2309
|
2
|
+
habiticalib/const.py,sha256=4Pqb9TaT1nfrV6Um4OXBpGkLLNqAT7gPACn4dzV5V5Q,624
|
3
|
+
habiticalib/exceptions.py,sha256=oVFCGbHkVn0UpIKIPZPzXfvzs9US4R05ebdEn6cOpqM,1350
|
4
|
+
habiticalib/helpers.py,sha256=IRZLYWkDVLI0iVBgBMmvZ6L83KCUl-CnzGhUR_tP6Fg,4576
|
5
|
+
habiticalib/lib.py,sha256=e-UwtfDWYrxl-N5Ylns7ZgU4knquEximdyBTQz4RcYQ,73500
|
6
|
+
habiticalib/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
7
|
+
habiticalib/types.py,sha256=bh_Fly_piJK-9tbKjS-pZB8Z5LL_pW8MHJj1NfCyb2E,42674
|
8
|
+
habiticalib-0.3.0.dist-info/METADATA,sha256=kneBKiOMlRDpX2qdLn6cYbFRBdpl4NOppCjIypw4bG0,4185
|
9
|
+
habiticalib-0.3.0.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
|
10
|
+
habiticalib-0.3.0.dist-info/licenses/LICENSE,sha256=oIinIOSJ49l1iVIRI3XGXFWt6SF7a83kEFBAY8ORwNI,1084
|
11
|
+
habiticalib-0.3.0.dist-info/RECORD,,
|
@@ -1,11 +0,0 @@
|
|
1
|
-
habiticalib/__init__.py,sha256=QwR7xcAdEwZ1bAv02KlZCm4sw-8-xKlYOUAaB502mCA,1687
|
2
|
-
habiticalib/const.py,sha256=hTmR0O6Bibw96tMCIy-Wsb_AC0K4AH1qiQVCJyJ_TAg,626
|
3
|
-
habiticalib/exceptions.py,sha256=oVFCGbHkVn0UpIKIPZPzXfvzs9US4R05ebdEn6cOpqM,1350
|
4
|
-
habiticalib/helpers.py,sha256=IRZLYWkDVLI0iVBgBMmvZ6L83KCUl-CnzGhUR_tP6Fg,4576
|
5
|
-
habiticalib/lib.py,sha256=_HPEjoH1o0wbSM26mIbzGEbfvAery3O8XDMTmUZEY2U,71271
|
6
|
-
habiticalib/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
7
|
-
habiticalib/types.py,sha256=ZmAkkDzXl9lj9fNWidlzjKkJ0CQStQVBi24u-3mgMPA,33907
|
8
|
-
habiticalib-0.2.0a1.dist-info/METADATA,sha256=Yfdhp5dWPEylm1Ri2yU1zC2569oODmC6vSCERfG80mY,4156
|
9
|
-
habiticalib-0.2.0a1.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
|
10
|
-
habiticalib-0.2.0a1.dist-info/licenses/LICENSE,sha256=oIinIOSJ49l1iVIRI3XGXFWt6SF7a83kEFBAY8ORwNI,1084
|
11
|
-
habiticalib-0.2.0a1.dist-info/RECORD,,
|
File without changes
|
File without changes
|