Habiticalib 0.1.0a2__py3-none-any.whl → 0.2.0a0__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 +6 -2
- habiticalib/const.py +1 -1
- habiticalib/exceptions.py +13 -4
- habiticalib/helpers.py +25 -1
- habiticalib/lib.py +28 -17
- habiticalib/types.py +83 -64
- {habiticalib-0.1.0a2.dist-info → habiticalib-0.2.0a0.dist-info}/METADATA +2 -3
- habiticalib-0.2.0a0.dist-info/RECORD +11 -0
- {habiticalib-0.1.0a2.dist-info → habiticalib-0.2.0a0.dist-info}/WHEEL +1 -1
- habiticalib-0.1.0a2.dist-info/RECORD +0 -11
- {habiticalib-0.1.0a2.dist-info → habiticalib-0.2.0a0.dist-info}/licenses/LICENSE +0 -0
habiticalib/__init__.py
CHANGED
@@ -6,18 +6,20 @@ from .exceptions import (
|
|
6
6
|
HabiticaException,
|
7
7
|
NotAuthorizedError,
|
8
8
|
NotFoundError,
|
9
|
+
TooManyRequestsError,
|
9
10
|
)
|
10
11
|
from .lib import Habitica
|
11
12
|
from .types import (
|
12
13
|
Attributes,
|
13
|
-
Class,
|
14
14
|
Direction,
|
15
15
|
Frequency,
|
16
|
+
HabiticaClass,
|
16
17
|
HabiticaClassSystemResponse,
|
17
18
|
HabiticaErrorResponse,
|
18
19
|
HabiticaLoginResponse,
|
19
20
|
HabiticaResponse,
|
20
21
|
HabiticaScoreResponse,
|
22
|
+
HabiticaSleepResponse,
|
21
23
|
HabiticaStatsResponse,
|
22
24
|
HabiticaTagResponse,
|
23
25
|
HabiticaTagsResponse,
|
@@ -39,17 +41,18 @@ __all__ = [
|
|
39
41
|
"ASSETS_URL",
|
40
42
|
"Attributes",
|
41
43
|
"BadRequestError",
|
42
|
-
"Class",
|
43
44
|
"DEFAULT_URL",
|
44
45
|
"Direction",
|
45
46
|
"Frequency",
|
46
47
|
"Habitica",
|
48
|
+
"HabiticaClass",
|
47
49
|
"HabiticaClassSystemResponse",
|
48
50
|
"HabiticaErrorResponse",
|
49
51
|
"HabiticaException",
|
50
52
|
"HabiticaLoginResponse",
|
51
53
|
"HabiticaResponse",
|
52
54
|
"HabiticaScoreResponse",
|
55
|
+
"HabiticaSleepResponse",
|
53
56
|
"HabiticaStatsResponse",
|
54
57
|
"HabiticaTagResponse",
|
55
58
|
"HabiticaTagsResponse",
|
@@ -65,5 +68,6 @@ __all__ = [
|
|
65
68
|
"Task",
|
66
69
|
"TaskFilter",
|
67
70
|
"TaskType",
|
71
|
+
"TooManyRequestsError",
|
68
72
|
"UserStyles",
|
69
73
|
]
|
habiticalib/const.py
CHANGED
habiticalib/exceptions.py
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
"""Exceptions for Habiticalib."""
|
2
2
|
|
3
|
+
from datetime import datetime
|
3
4
|
from typing import Self
|
4
5
|
|
5
6
|
from multidict import CIMultiDictProxy
|
@@ -17,10 +18,18 @@ class HabiticaException(Exception): # noqa: N818
|
|
17
18
|
) -> None:
|
18
19
|
"""Initialize the Exception."""
|
19
20
|
self.error = error
|
20
|
-
self.rate_limit =
|
21
|
-
|
22
|
-
|
23
|
-
self.
|
21
|
+
self.rate_limit: int | None = (
|
22
|
+
int(r) if (r := headers.get("x-ratelimit-limit")) else None
|
23
|
+
)
|
24
|
+
self.rate_limit_remaining: int | None = (
|
25
|
+
int(r) if (r := headers.get("x-ratelimit-remaining")) else None
|
26
|
+
)
|
27
|
+
self.rate_limit_reset: datetime | None = (
|
28
|
+
datetime.strptime(r[:33], "%a %b %d %Y %H:%M:%S %Z%z")
|
29
|
+
if (r := headers.get("x-ratelimit-reset"))
|
30
|
+
else None
|
31
|
+
)
|
32
|
+
self.retry_after: int = round(float(headers.get("retry-after", 0)))
|
24
33
|
|
25
34
|
super().__init__(error.message)
|
26
35
|
|
habiticalib/helpers.py
CHANGED
@@ -1,7 +1,10 @@
|
|
1
1
|
"""Helper functions for Habiticalib."""
|
2
2
|
|
3
|
-
from dataclasses import asdict
|
3
|
+
from dataclasses import asdict, is_dataclass
|
4
|
+
from datetime import date, datetime
|
5
|
+
from enum import Enum
|
4
6
|
import platform
|
7
|
+
from typing import Any
|
5
8
|
import uuid
|
6
9
|
|
7
10
|
import aiohttp
|
@@ -112,3 +115,24 @@ def extract_user_styles(user_data: HabiticaUserResponse) -> UserStyles:
|
|
112
115
|
"""Extract user styles from a user data object."""
|
113
116
|
data: UserData = user_data.data
|
114
117
|
return UserStyles.from_dict(asdict(data))
|
118
|
+
|
119
|
+
|
120
|
+
def deserialize_task(value: Any) -> Any: # noqa: PLR0911
|
121
|
+
"""Recursively convert Enums to values, dates to ISO strings, UUIDs to strings."""
|
122
|
+
|
123
|
+
if is_dataclass(value) and not isinstance(value, type):
|
124
|
+
# Convert dataclass to dict and recursively deserialize
|
125
|
+
return deserialize_task(asdict(value))
|
126
|
+
if isinstance(value, Enum):
|
127
|
+
return value.value # Convert Enum to its value
|
128
|
+
if isinstance(value, uuid.UUID):
|
129
|
+
return str(value) # Convert UUID to string
|
130
|
+
if isinstance(value, datetime | date):
|
131
|
+
return value.isoformat() # Convert datetime/date to ISO string
|
132
|
+
if isinstance(value, list):
|
133
|
+
# Recursively apply deserialization to each item in the list
|
134
|
+
return [deserialize_task(item) for item in value]
|
135
|
+
if isinstance(value, dict):
|
136
|
+
# Recursively apply deserialization to each key-value pair in the dictionary
|
137
|
+
return {k: deserialize_task(v) for k, v in value.items()}
|
138
|
+
return value # Return other types unchanged
|
habiticalib/lib.py
CHANGED
@@ -19,16 +19,23 @@ from .exceptions import (
|
|
19
19
|
NotFoundError,
|
20
20
|
TooManyRequestsError,
|
21
21
|
)
|
22
|
-
from .helpers import
|
22
|
+
from .helpers import (
|
23
|
+
deserialize_task,
|
24
|
+
extract_user_styles,
|
25
|
+
get_user_agent,
|
26
|
+
get_x_client,
|
27
|
+
join_fields,
|
28
|
+
)
|
23
29
|
from .types import (
|
24
30
|
Attributes,
|
25
|
-
Class,
|
26
31
|
Direction,
|
32
|
+
HabiticaClass,
|
27
33
|
HabiticaClassSystemResponse,
|
28
34
|
HabiticaErrorResponse,
|
29
35
|
HabiticaLoginResponse,
|
30
36
|
HabiticaResponse,
|
31
37
|
HabiticaScoreResponse,
|
38
|
+
HabiticaSleepResponse,
|
32
39
|
HabiticaStatsResponse,
|
33
40
|
HabiticaTagResponse,
|
34
41
|
HabiticaTagsResponse,
|
@@ -378,14 +385,16 @@ class Habitica:
|
|
378
385
|
|
379
386
|
Examples
|
380
387
|
--------
|
381
|
-
>>> new_task = Task(
|
388
|
+
>>> new_task = Task(text="New Task", type=TaskType.TODO ...)
|
382
389
|
>>> create_response = await habitica.create_task(new_task)
|
383
390
|
>>> print(create_response.data) # Displays the created task information
|
384
391
|
"""
|
385
392
|
url = self.url / "api/v3/tasks/user"
|
386
393
|
|
394
|
+
json = deserialize_task(task)
|
395
|
+
|
387
396
|
return HabiticaTaskResponse.from_json(
|
388
|
-
await self._request("post", url=url, json=
|
397
|
+
await self._request("post", url=url, json=json),
|
389
398
|
)
|
390
399
|
|
391
400
|
async def update_task(self, task_id: UUID, task: Task) -> HabiticaTaskResponse:
|
@@ -421,14 +430,16 @@ class Habitica:
|
|
421
430
|
Examples
|
422
431
|
--------
|
423
432
|
>>> task_id = UUID("12345678-1234-5678-1234-567812345678")
|
424
|
-
>>> updated_task = Task(
|
433
|
+
>>> updated_task = Task(text="Updated Task", ...)
|
425
434
|
>>> update_response = await habitica.update_task(task_id, updated_task)
|
426
435
|
>>> print(update_response.data) # Displays the updated task information
|
427
436
|
"""
|
428
437
|
url = self.url / "api/v3/tasks" / str(task_id)
|
429
438
|
|
439
|
+
json = deserialize_task(task)
|
440
|
+
|
430
441
|
return HabiticaTaskResponse.from_json(
|
431
|
-
await self._request("put", url=url, json=
|
442
|
+
await self._request("put", url=url, json=json),
|
432
443
|
)
|
433
444
|
|
434
445
|
async def delete_task(self, task_id: UUID) -> HabiticaResponse:
|
@@ -799,14 +810,14 @@ class Habitica:
|
|
799
810
|
|
800
811
|
async def cast_skill(
|
801
812
|
self,
|
802
|
-
|
813
|
+
skill: Skill,
|
803
814
|
target_id: UUID | None = None,
|
804
815
|
) -> HabiticaUserResponse:
|
805
816
|
"""Cast a skill (spell) in Habitica, optionally targeting a specific user, task or party.
|
806
817
|
|
807
818
|
Parameters
|
808
819
|
----------
|
809
|
-
|
820
|
+
skill : Skill
|
810
821
|
The skill (or spell) to be cast. This should be a valid `Skill` enum value.
|
811
822
|
target_id : UUID, optional
|
812
823
|
The unique identifier of the target for the skill. If the skill does not require a target,
|
@@ -832,7 +843,7 @@ class Habitica:
|
|
832
843
|
TimeoutError
|
833
844
|
If the connection times out.
|
834
845
|
"""
|
835
|
-
url = self.url / "api/v3/class/cast" /
|
846
|
+
url = self.url / "api/v3/user/class/cast" / skill
|
836
847
|
params = {}
|
837
848
|
|
838
849
|
if target_id:
|
@@ -843,12 +854,12 @@ class Habitica:
|
|
843
854
|
|
844
855
|
async def toggle_sleep(
|
845
856
|
self,
|
846
|
-
) ->
|
857
|
+
) -> HabiticaSleepResponse:
|
847
858
|
"""Toggles the user's sleep mode in Habitica.
|
848
859
|
|
849
860
|
Returns
|
850
861
|
-------
|
851
|
-
|
862
|
+
HabiticaSleepResponse
|
852
863
|
A response object containing the result of the sleep mode toggle,
|
853
864
|
and the new sleep state (True if sleeping, False if not).
|
854
865
|
|
@@ -865,7 +876,7 @@ class Habitica:
|
|
865
876
|
"""
|
866
877
|
url = self.url / "api/v3/user/sleep"
|
867
878
|
|
868
|
-
return
|
879
|
+
return HabiticaSleepResponse.from_json(await self._request("post", url=url))
|
869
880
|
|
870
881
|
async def revive(
|
871
882
|
self,
|
@@ -889,7 +900,7 @@ class Habitica:
|
|
889
900
|
|
890
901
|
return HabiticaResponse.from_json(await self._request("post", url=url))
|
891
902
|
|
892
|
-
async def change_class(self, Class:
|
903
|
+
async def change_class(self, Class: HabiticaClass) -> HabiticaClassSystemResponse: # noqa: N803
|
893
904
|
"""Change the user's class in Habitica.
|
894
905
|
|
895
906
|
This method sends a request to the Habitica API to change the user's class
|
@@ -920,7 +931,7 @@ class Habitica:
|
|
920
931
|
|
921
932
|
Examples
|
922
933
|
--------
|
923
|
-
>>> new_class =
|
934
|
+
>>> new_class = HabiticaClass.WARRIOR
|
924
935
|
>>> change_response = await habitica.change_class(new_class)
|
925
936
|
>>> print(change_response.data.stats) # Displays the user's stats after class change
|
926
937
|
"""
|
@@ -1068,7 +1079,7 @@ class Habitica:
|
|
1068
1079
|
url = self.url / "api/v3/tags"
|
1069
1080
|
|
1070
1081
|
return HabiticaTagsResponse.from_json(
|
1071
|
-
await self._request("
|
1082
|
+
await self._request("get", url=url),
|
1072
1083
|
)
|
1073
1084
|
|
1074
1085
|
async def get_tag(self, tag_id: UUID) -> HabiticaTagResponse:
|
@@ -1106,7 +1117,7 @@ class Habitica:
|
|
1106
1117
|
url = self.url / "api/v3/tags" / str(tag_id)
|
1107
1118
|
|
1108
1119
|
return HabiticaTagResponse.from_json(
|
1109
|
-
await self._request("
|
1120
|
+
await self._request("get", url=url),
|
1110
1121
|
)
|
1111
1122
|
|
1112
1123
|
async def delete_tag(self, tag_id: UUID) -> HabiticaResponse:
|
@@ -1266,7 +1277,7 @@ class Habitica:
|
|
1266
1277
|
url = self.url / "api/v3/reorder-tags"
|
1267
1278
|
json = {"tagId": str(tag_id), "to": to}
|
1268
1279
|
|
1269
|
-
return
|
1280
|
+
return HabiticaResponse.from_json(
|
1270
1281
|
await self._request("post", url=url, json=json),
|
1271
1282
|
)
|
1272
1283
|
|
habiticalib/types.py
CHANGED
@@ -4,13 +4,13 @@
|
|
4
4
|
from __future__ import annotations
|
5
5
|
|
6
6
|
from dataclasses import dataclass, field
|
7
|
+
import datetime as dt
|
7
8
|
from datetime import UTC, datetime
|
8
9
|
from enum import Enum, StrEnum
|
9
|
-
from typing import Any
|
10
|
+
from typing import Any, NotRequired, TypedDict
|
10
11
|
from uuid import UUID # noqa: TCH003
|
11
12
|
|
12
13
|
from mashumaro import field_options
|
13
|
-
from mashumaro.config import BaseConfig
|
14
14
|
from mashumaro.mixins.orjson import DataClassORJSONMixin
|
15
15
|
|
16
16
|
|
@@ -61,6 +61,7 @@ class LoginData:
|
|
61
61
|
apiToken: str
|
62
62
|
newUser: bool
|
63
63
|
username: str
|
64
|
+
passwordResetCode: str | None = None
|
64
65
|
|
65
66
|
|
66
67
|
@dataclass(kw_only=True)
|
@@ -74,27 +75,27 @@ class HabiticaLoginResponse(HabiticaResponse):
|
|
74
75
|
class LocalAuth:
|
75
76
|
"""Auth local data."""
|
76
77
|
|
77
|
-
email: str
|
78
|
-
username: str
|
79
|
-
lowerCaseUsername: str
|
80
|
-
has_password: bool
|
78
|
+
email: str | None = None
|
79
|
+
username: str | None = None
|
80
|
+
lowerCaseUsername: str | None = None
|
81
|
+
has_password: bool | None = None
|
81
82
|
|
82
83
|
|
83
84
|
@dataclass(kw_only=True)
|
84
85
|
class LocalTimestamps:
|
85
86
|
"""Timestamps local data."""
|
86
87
|
|
87
|
-
created: datetime
|
88
|
-
loggedin: datetime
|
89
|
-
updated: datetime
|
88
|
+
created: datetime | None = None
|
89
|
+
loggedin: datetime | None = None
|
90
|
+
updated: datetime | None = None
|
90
91
|
|
91
92
|
|
92
93
|
@dataclass(kw_only=True)
|
93
94
|
class AuthUser:
|
94
95
|
"""User auth data."""
|
95
96
|
|
96
|
-
local: LocalAuth
|
97
|
-
timestamps: LocalTimestamps
|
97
|
+
local: LocalAuth = field(default_factory=LocalAuth)
|
98
|
+
timestamps: LocalTimestamps = field(default_factory=LocalTimestamps)
|
98
99
|
facebook: dict | None = None
|
99
100
|
google: dict | None = None
|
100
101
|
apple: dict | None = None
|
@@ -628,6 +629,15 @@ class TrainingStats:
|
|
628
629
|
Int: int | None = field(default=None, metadata=field_options(alias="int"))
|
629
630
|
|
630
631
|
|
632
|
+
class HabiticaClass(StrEnum):
|
633
|
+
"""Habitica's player classes."""
|
634
|
+
|
635
|
+
WARRIOR = "warrior"
|
636
|
+
ROGUE = "rogue"
|
637
|
+
MAGE = "wizard"
|
638
|
+
HEALER = "healer"
|
639
|
+
|
640
|
+
|
631
641
|
@dataclass(kw_only=True)
|
632
642
|
class StatsUser:
|
633
643
|
"""Stats user data."""
|
@@ -639,7 +649,9 @@ class StatsUser:
|
|
639
649
|
exp: int | None = None
|
640
650
|
gp: float | None = None
|
641
651
|
lvl: int | None = None
|
642
|
-
Class:
|
652
|
+
Class: HabiticaClass | None = field(
|
653
|
+
default=None, metadata=field_options(alias="class")
|
654
|
+
)
|
643
655
|
points: int | None = None
|
644
656
|
Str: int | None = field(default=None, metadata=field_options(alias="str"))
|
645
657
|
con: int | None = None
|
@@ -650,6 +662,13 @@ class StatsUser:
|
|
650
662
|
Int: int | None = field(default=None, metadata=field_options(alias="int"))
|
651
663
|
|
652
664
|
|
665
|
+
field(
|
666
|
+
metadata=field_options(
|
667
|
+
deserialize=serialize_datetime,
|
668
|
+
)
|
669
|
+
)
|
670
|
+
|
671
|
+
|
653
672
|
@dataclass(kw_only=True)
|
654
673
|
class TagsUser:
|
655
674
|
"""Tags user data."""
|
@@ -674,10 +693,10 @@ class InboxUser:
|
|
674
693
|
class TasksOrderUser:
|
675
694
|
"""TasksOrder user data."""
|
676
695
|
|
677
|
-
habits: list[
|
678
|
-
dailys: list[
|
679
|
-
todos: list[
|
680
|
-
rewards: list[
|
696
|
+
habits: list[UUID] = field(default_factory=list)
|
697
|
+
dailys: list[UUID] = field(default_factory=list)
|
698
|
+
todos: list[UUID] = field(default_factory=list)
|
699
|
+
rewards: list[UUID] = field(default_factory=list)
|
681
700
|
|
682
701
|
|
683
702
|
@dataclass(kw_only=True)
|
@@ -717,7 +736,7 @@ class UserData:
|
|
717
736
|
|
718
737
|
id: UUID | None = None
|
719
738
|
preferences: PreferencesUser = field(default_factory=PreferencesUser)
|
720
|
-
flags: FlagsUser
|
739
|
+
flags: FlagsUser = field(default_factory=FlagsUser)
|
721
740
|
auth: AuthUser = field(default_factory=AuthUser)
|
722
741
|
achievements: AchievementsUser = field(default_factory=AchievementsUser)
|
723
742
|
backer: BackerUser = field(default_factory=BackerUser)
|
@@ -746,8 +765,8 @@ class UserData:
|
|
746
765
|
balance: float | None = None
|
747
766
|
lastCron: datetime | None = None
|
748
767
|
needsCron: bool | None = None
|
749
|
-
challenges: list[
|
750
|
-
guilds: list[
|
768
|
+
challenges: list[UUID] = field(default_factory=list)
|
769
|
+
guilds: list[UUID] = field(default_factory=list)
|
751
770
|
newMessages: dict[str, bool] = field(default_factory=dict)
|
752
771
|
|
753
772
|
|
@@ -850,38 +869,31 @@ class Frequency(StrEnum):
|
|
850
869
|
YEARLY = "yearly"
|
851
870
|
|
852
871
|
|
853
|
-
|
854
|
-
class Task(DataClassORJSONMixin):
|
872
|
+
class Task(TypedDict("Task", {"type": NotRequired[TaskType]}), total=True):
|
855
873
|
"""Representation of a task."""
|
856
874
|
|
857
|
-
|
858
|
-
|
859
|
-
|
860
|
-
|
861
|
-
|
862
|
-
|
863
|
-
|
864
|
-
|
865
|
-
|
866
|
-
|
867
|
-
|
868
|
-
|
869
|
-
|
870
|
-
|
871
|
-
|
872
|
-
|
873
|
-
|
874
|
-
|
875
|
-
|
876
|
-
|
877
|
-
|
878
|
-
|
879
|
-
everyX: int | None = None
|
880
|
-
repeat: Repeat | None = None
|
881
|
-
daysOfMonth: list[int] | None = None
|
882
|
-
weeksOfMonth: list[int] | None = None
|
883
|
-
completed: bool | None = None
|
884
|
-
streak: int | None = None
|
875
|
+
text: NotRequired[str]
|
876
|
+
attribute: NotRequired[Attributes]
|
877
|
+
alias: NotRequired[str]
|
878
|
+
notes: NotRequired[str]
|
879
|
+
tags: NotRequired[list[UUID]]
|
880
|
+
collapseChecklist: NotRequired[bool]
|
881
|
+
date: NotRequired[datetime | dt.date | None]
|
882
|
+
priority: NotRequired[TaskPriority]
|
883
|
+
reminders: NotRequired[list[Reminders]]
|
884
|
+
checklist: NotRequired[list[str]]
|
885
|
+
up: NotRequired[bool]
|
886
|
+
down: NotRequired[bool]
|
887
|
+
counterUp: NotRequired[int]
|
888
|
+
counterDown: NotRequired[int]
|
889
|
+
startDate: NotRequired[datetime | dt.date]
|
890
|
+
frequency: NotRequired[Frequency]
|
891
|
+
everyX: NotRequired[int]
|
892
|
+
repeat: NotRequired[Repeat]
|
893
|
+
daysOfMonth: NotRequired[list[int]]
|
894
|
+
weeksOfMonth: NotRequired[list[int]]
|
895
|
+
completed: NotRequired[bool]
|
896
|
+
streak: NotRequired[int]
|
885
897
|
|
886
898
|
|
887
899
|
@dataclass(kw_only=True)
|
@@ -979,7 +991,7 @@ class StatsUserStyles:
|
|
979
991
|
"""Stats user styles data."""
|
980
992
|
|
981
993
|
buffs: BuffsUserStyles = field(default_factory=BuffsUserStyles)
|
982
|
-
Class:
|
994
|
+
Class: HabiticaClass = field(default=HabiticaClass.WARRIOR)
|
983
995
|
|
984
996
|
|
985
997
|
@dataclass(kw_only=True)
|
@@ -1052,7 +1064,7 @@ class DropTmpScore:
|
|
1052
1064
|
canDrop: bool | None = None
|
1053
1065
|
value: int | None = None
|
1054
1066
|
key: str | None = None
|
1055
|
-
|
1067
|
+
Type: str | None = field(default=None, metadata=field_options(alias="type"))
|
1056
1068
|
dialog: str | None = None
|
1057
1069
|
|
1058
1070
|
|
@@ -1064,12 +1076,21 @@ class TmpScore:
|
|
1064
1076
|
drop: DropTmpScore = field(default_factory=DropTmpScore)
|
1065
1077
|
|
1066
1078
|
|
1079
|
+
@dataclass
|
1080
|
+
class ScoreData(StatsUser):
|
1081
|
+
"""Scora data."""
|
1082
|
+
|
1083
|
+
delta: float | None = None
|
1084
|
+
tmp: TmpScore = field(
|
1085
|
+
default_factory=TmpScore, metadata=field_options(alias="_tmp")
|
1086
|
+
)
|
1087
|
+
|
1088
|
+
|
1067
1089
|
@dataclass(kw_only=True)
|
1068
|
-
class HabiticaScoreResponse(
|
1090
|
+
class HabiticaScoreResponse(HabiticaResponse, DataClassORJSONMixin):
|
1069
1091
|
"""Representation of a score response."""
|
1070
1092
|
|
1071
|
-
|
1072
|
-
_tmp: TmpScore = field(default_factory=TmpScore)
|
1093
|
+
data: ScoreData
|
1073
1094
|
|
1074
1095
|
|
1075
1096
|
@dataclass(kw_only=True)
|
@@ -1107,7 +1128,14 @@ class HabiticaClassSystemResponse(HabiticaResponse, DataClassORJSONMixin):
|
|
1107
1128
|
class HabiticaTaskOrderResponse(HabiticaResponse):
|
1108
1129
|
"""Representation of a reorder task response."""
|
1109
1130
|
|
1110
|
-
data:
|
1131
|
+
data: list[UUID] = field(default_factory=list)
|
1132
|
+
|
1133
|
+
|
1134
|
+
@dataclass
|
1135
|
+
class HabiticaSleepResponse(HabiticaResponse):
|
1136
|
+
"""Representation of a sleep response."""
|
1137
|
+
|
1138
|
+
data: bool
|
1111
1139
|
|
1112
1140
|
|
1113
1141
|
class TaskFilter(StrEnum):
|
@@ -1187,15 +1215,6 @@ class Skill(StrEnum):
|
|
1187
1215
|
PETAL_FREE_POTION = "petalFreePotion"
|
1188
1216
|
|
1189
1217
|
|
1190
|
-
class Class(StrEnum):
|
1191
|
-
"""Habitica's player classes."""
|
1192
|
-
|
1193
|
-
WARRIOR = "warrior"
|
1194
|
-
ROGUE = "rogue"
|
1195
|
-
MAGE = "mage"
|
1196
|
-
HEALER = "healer"
|
1197
|
-
|
1198
|
-
|
1199
1218
|
class Direction(StrEnum):
|
1200
1219
|
"""Direction to score a task."""
|
1201
1220
|
|
@@ -1,12 +1,11 @@
|
|
1
1
|
Metadata-Version: 2.3
|
2
2
|
Name: Habiticalib
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.2.0a0
|
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
|
7
7
|
Author-email: Manfred Dennerlein Rodelo <manfred@dennerlein.name>
|
8
8
|
License: MIT License
|
9
|
-
License-File: LICENSE
|
10
9
|
Classifier: License :: OSI Approved :: MIT License
|
11
10
|
Classifier: Operating System :: OS Independent
|
12
11
|
Classifier: Programming Language :: Python :: 3 :: Only
|
@@ -14,7 +13,7 @@ Requires-Python: >=3.12
|
|
14
13
|
Requires-Dist: aiohttp~=3.9
|
15
14
|
Requires-Dist: mashumaro~=3.13
|
16
15
|
Requires-Dist: orjson~=3.10
|
17
|
-
Requires-Dist: pillow~=
|
16
|
+
Requires-Dist: pillow~=11.0
|
18
17
|
Description-Content-Type: text/markdown
|
19
18
|
|
20
19
|
# Habiticalib
|
@@ -0,0 +1,11 @@
|
|
1
|
+
habiticalib/__init__.py,sha256=gR6mjGbUe7tD3bR5UDSPXgKCtP-rfgknHi-XIP41HLk,1617
|
2
|
+
habiticalib/const.py,sha256=tJbptyPWBga1PdjCeDzutNCVsT5BIyvO9nUfFGO1D90,609
|
3
|
+
habiticalib/exceptions.py,sha256=oVFCGbHkVn0UpIKIPZPzXfvzs9US4R05ebdEn6cOpqM,1350
|
4
|
+
habiticalib/helpers.py,sha256=IRZLYWkDVLI0iVBgBMmvZ6L83KCUl-CnzGhUR_tP6Fg,4576
|
5
|
+
habiticalib/lib.py,sha256=JXx7PGrl74fJdTj_TKKzIr84Kl-hgCBDy0yvaMXXgD8,54316
|
6
|
+
habiticalib/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
7
|
+
habiticalib/types.py,sha256=DAIKNhsc0KWSWBcfVrcP7XeZ3QlbFsuWyxt_326Lrvw,33309
|
8
|
+
habiticalib-0.2.0a0.dist-info/METADATA,sha256=d_1DFcqvff_2feSeV1blBEmOlkZ1qChdQMxKirA7ics,4156
|
9
|
+
habiticalib-0.2.0a0.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
|
10
|
+
habiticalib-0.2.0a0.dist-info/licenses/LICENSE,sha256=oIinIOSJ49l1iVIRI3XGXFWt6SF7a83kEFBAY8ORwNI,1084
|
11
|
+
habiticalib-0.2.0a0.dist-info/RECORD,,
|
@@ -1,11 +0,0 @@
|
|
1
|
-
habiticalib/__init__.py,sha256=_RUFLOZSqQWr_j3TnhHhtD5szaf59HR-sS7aOpE4NTg,1491
|
2
|
-
habiticalib/const.py,sha256=NsbZeJ3Z_OuZcGzFZESInj9vpyYzjjCpJnVhGmu30vw,609
|
3
|
-
habiticalib/exceptions.py,sha256=Db7lDDdT97FsK4S9N45gcusiMMWiqeIcab0H8i7xTtE,1032
|
4
|
-
habiticalib/helpers.py,sha256=Y7lAlufK2isnNp7ybcqcWLG9xkWltouCiXaBeLOkobg,3479
|
5
|
-
habiticalib/lib.py,sha256=F_tqIULUC8mhYXLak2RYGA_AeaFuAQY6Ie8NImslv_g,54130
|
6
|
-
habiticalib/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
7
|
-
habiticalib/types.py,sha256=zF9HzSXkuUYwuUv9F8fXfg6sxWy0nlfUo9hFqQG8eGA,32825
|
8
|
-
habiticalib-0.1.0a2.dist-info/METADATA,sha256=3hI8OP0ECfHdmYPaZ9zGyX0Nx04kRly2635ll4yfrYY,4178
|
9
|
-
habiticalib-0.1.0a2.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
|
10
|
-
habiticalib-0.1.0a2.dist-info/licenses/LICENSE,sha256=oIinIOSJ49l1iVIRI3XGXFWt6SF7a83kEFBAY8ORwNI,1084
|
11
|
-
habiticalib-0.1.0a2.dist-info/RECORD,,
|
File without changes
|