Habiticalib 0.2.0a1__py3-none-any.whl → 0.2.0a2__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 CHANGED
@@ -15,9 +15,11 @@ from .types import (
15
15
  Frequency,
16
16
  HabiticaClass,
17
17
  HabiticaClassSystemResponse,
18
+ HabiticaContentResponse,
18
19
  HabiticaErrorResponse,
19
20
  HabiticaGroupMembersResponse,
20
21
  HabiticaLoginResponse,
22
+ HabiticaQuestResponse,
21
23
  HabiticaResponse,
22
24
  HabiticaScoreResponse,
23
25
  HabiticaSleepResponse,
@@ -48,10 +50,12 @@ __all__ = [
48
50
  "Habitica",
49
51
  "HabiticaClass",
50
52
  "HabiticaClassSystemResponse",
53
+ "HabiticaContentResponse",
51
54
  "HabiticaErrorResponse",
52
55
  "HabiticaException",
53
56
  "HabiticaGroupMembersResponse",
54
57
  "HabiticaLoginResponse",
58
+ "HabiticaQuestResponse",
55
59
  "HabiticaResponse",
56
60
  "HabiticaScoreResponse",
57
61
  "HabiticaSleepResponse",
habiticalib/const.py CHANGED
@@ -1,6 +1,6 @@
1
1
  """Constants for Habiticalib."""
2
2
 
3
- __version__ = "0.2.0a1"
3
+ __version__ = "0.2.0a2"
4
4
 
5
5
  DEFAULT_URL = "https://habitica.com/"
6
6
  ASSETS_URL = "https://habitica-assets.s3.amazonaws.com/mobileApp/images/"
habiticalib/lib.py CHANGED
@@ -31,6 +31,7 @@ from .types import (
31
31
  Direction,
32
32
  HabiticaClass,
33
33
  HabiticaClassSystemResponse,
34
+ HabiticaContentResponse,
34
35
  HabiticaErrorResponse,
35
36
  HabiticaGroupMembersResponse,
36
37
  HabiticaLoginResponse,
@@ -263,14 +264,15 @@ class Habitica:
263
264
  self,
264
265
  task_type: TaskFilter | None = None,
265
266
  due_date: datetime | None = None,
266
- ) -> HabiticaResponse:
267
+ ) -> HabiticaTasksResponse:
267
268
  """Get the authenticated user's tasks.
268
269
 
269
270
  Parameters
270
271
  ----------
271
272
  task_type : TaskFilter | None
272
273
  The type of task to retrieve, defined in TaskFilter enum.
273
- If `None`, all task types will be retrieved (default is None).
274
+ If `None`, all task types will be retrieved except completed to-dos
275
+ (default is None).
274
276
 
275
277
  due_date : datetime | None
276
278
  Optional date to use for computing the nextDue field for each returned task.
@@ -458,7 +460,7 @@ class Habitica:
458
460
  Returns
459
461
  -------
460
462
  HabiticaTaskResponse
461
- A response object containing the data for the deleted task.
463
+ A response containing an empty data object.
462
464
 
463
465
  Raises
464
466
  ------
@@ -562,7 +564,7 @@ class Habitica:
562
564
  async def get_content(
563
565
  self,
564
566
  language: Language | None = None,
565
- ) -> HabiticaResponse:
567
+ ) -> HabiticaContentResponse:
566
568
  """
567
569
  Fetch game content from the Habitica API.
568
570
 
@@ -604,7 +606,7 @@ class Habitica:
604
606
  if language:
605
607
  params.update({"language": language.value})
606
608
 
607
- return HabiticaResponse.from_json(
609
+ return HabiticaContentResponse.from_json(
608
610
  await self._request("get", url=url, params=params),
609
611
  )
610
612
 
habiticalib/types.py CHANGED
@@ -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: str | None = None
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."""
@@ -1255,3 +1248,387 @@ class TaskPriority(Enum):
1255
1248
  EASY = 1
1256
1249
  MEDIUM = 1.5
1257
1250
  HARD = 2
1251
+
1252
+
1253
+ @dataclass
1254
+ class AchievmentContent:
1255
+ """Achievment content data."""
1256
+
1257
+ icon: str
1258
+ key: str
1259
+ titleKey: str | None = None
1260
+ textKey: str | None = None
1261
+ singularTitleKey: str | None = None
1262
+ singularTextKey: str | None = None
1263
+ pluralTitleKey: str | None = None
1264
+ pluralTextKey: str | None = None
1265
+
1266
+
1267
+ @dataclass
1268
+ class AnimalColorAchievementContent:
1269
+ """animalColorAchievement content data."""
1270
+
1271
+ color: str
1272
+ petAchievement: str
1273
+ petNotificationType: str
1274
+ mountAchievement: str
1275
+ mountNotificationType: str
1276
+
1277
+
1278
+ @dataclass
1279
+ class AnimalSetAchievementContent:
1280
+ """animalSetAchievements content data."""
1281
+
1282
+ Type: str = field(metadata=field_options(alias="type"))
1283
+ species: list[str]
1284
+ achievementKey: str
1285
+ notificationType: str
1286
+
1287
+
1288
+ @dataclass
1289
+ class StableAchievementContent:
1290
+ """stableAchievements content data."""
1291
+
1292
+ masterAchievement: str
1293
+ masterNotificationType: str
1294
+
1295
+
1296
+ @dataclass
1297
+ class PetSetCompleteAchievsContent:
1298
+ """petSetCompleteAchievs content data."""
1299
+
1300
+ color: str
1301
+ petAchievement: str
1302
+ petNotificationType: str
1303
+
1304
+
1305
+ @dataclass
1306
+ class QuestBossRage:
1307
+ """QuestBossRage content data."""
1308
+
1309
+ title: str
1310
+ description: str
1311
+ value: float
1312
+ effect: str | None = None
1313
+ healing: float | None = None
1314
+
1315
+
1316
+ @dataclass
1317
+ class QuestBoss:
1318
+ """QuestBoss content data."""
1319
+
1320
+ name: str
1321
+ hp: float
1322
+ Str: float = field(metadata=field_options(alias="str"))
1323
+ Def: float = field(metadata=field_options(alias="def"))
1324
+ rage: QuestBossRage | None = None
1325
+
1326
+
1327
+ @dataclass
1328
+ class QuestItem:
1329
+ """QuestItem content data."""
1330
+
1331
+ Type: str = field(metadata=field_options(alias="type"))
1332
+ key: str
1333
+ text: str
1334
+
1335
+
1336
+ @dataclass
1337
+ class QuestDrop:
1338
+ """QuestDrop content data."""
1339
+
1340
+ gp: float
1341
+ exp: float
1342
+ items: list[QuestItem] | None = None
1343
+
1344
+
1345
+ @dataclass
1346
+ class QuestCollect:
1347
+ """QuestCollect content data."""
1348
+
1349
+ text: str
1350
+ count: int
1351
+
1352
+
1353
+ @dataclass
1354
+ class QuestUnlockCondition:
1355
+ """QuestUnlockCondition content data."""
1356
+
1357
+ condition: str
1358
+ text: str
1359
+
1360
+
1361
+ @dataclass
1362
+ class QuestsContent:
1363
+ """petSetCompleteAchievs content data."""
1364
+
1365
+ text: str
1366
+ notes: str
1367
+
1368
+ completion: str
1369
+ category: str
1370
+
1371
+ drop: QuestDrop
1372
+ key: str
1373
+ goldValue: float | None = None
1374
+ value: float | None = None
1375
+ previous: str | None = None
1376
+ prereqQuests: list[str] | None = None
1377
+ collect: dict[str, QuestCollect] | None = None
1378
+ unlockCondition: QuestUnlockCondition | None = None
1379
+ boss: QuestBoss | None = None
1380
+ group: str | None = None
1381
+
1382
+
1383
+ @dataclass
1384
+ class ItemListEntry:
1385
+ """ItemListEntry content data."""
1386
+
1387
+ localeKey: str
1388
+ isEquipment: bool
1389
+
1390
+
1391
+ @dataclass
1392
+ class ItemListContent:
1393
+ """ItemListContent content data."""
1394
+
1395
+ weapon: ItemListEntry
1396
+ armor: ItemListEntry
1397
+ head: ItemListEntry
1398
+ shield: ItemListEntry
1399
+ back: ItemListEntry
1400
+ body: ItemListEntry
1401
+ headAccessory: ItemListEntry
1402
+ eyewear: ItemListEntry
1403
+ hatchingPotions: ItemListEntry
1404
+ premiumHatchingPotions: ItemListEntry
1405
+ eggs: ItemListEntry
1406
+ quests: ItemListEntry
1407
+ food: ItemListEntry
1408
+ Saddle: ItemListEntry
1409
+ bundles: ItemListEntry
1410
+
1411
+
1412
+ @dataclass
1413
+ class GearEntry:
1414
+ """GearEntry content data."""
1415
+
1416
+ text: str
1417
+ notes: str
1418
+ Int: int = field(metadata=field_options(alias="int"))
1419
+ value: int
1420
+ Type: str = field(metadata=field_options(alias="type"))
1421
+ key: str
1422
+ Set: str = field(metadata=field_options(alias="set"))
1423
+ klass: str
1424
+ index: str
1425
+ Str: int = field(metadata=field_options(alias="str"))
1426
+ per: int
1427
+ con: int
1428
+
1429
+
1430
+ @dataclass
1431
+ class GearClass:
1432
+ """GearClass content data."""
1433
+
1434
+ base: dict[str, GearEntry] | None = None
1435
+ warrior: dict[str, GearEntry] | None = None
1436
+ wizard: dict[str, GearEntry] | None = None
1437
+ rogue: dict[str, GearEntry] | None = None
1438
+ special: dict[str, GearEntry] | None = None
1439
+ armoire: dict[str, GearEntry] | None = None
1440
+ mystery: dict[str, GearEntry] | None = None
1441
+ healer: dict[str, GearEntry] | None = None
1442
+
1443
+
1444
+ @dataclass
1445
+ class GearType:
1446
+ """GearType content data."""
1447
+
1448
+ weapon: GearClass
1449
+ armor: GearClass
1450
+ head: GearClass
1451
+ shield: GearClass
1452
+ back: GearClass
1453
+ body: GearClass
1454
+ headAccessory: GearClass
1455
+ eyewear: GearClass
1456
+
1457
+
1458
+ @dataclass
1459
+ class GearContent:
1460
+ """GearContent content data."""
1461
+
1462
+ tree: GearType
1463
+ flat: dict[str, GearEntry]
1464
+
1465
+
1466
+ @dataclass
1467
+ class SpellEntry:
1468
+ """SpellEntry content data."""
1469
+
1470
+ text: str
1471
+ mana: int
1472
+ target: str
1473
+ notes: str
1474
+ key: str
1475
+ previousPurchase: bool | None = None
1476
+ limited: bool | None = None
1477
+ lvl: int | None = None
1478
+ value: int | None = None
1479
+ immediateUse: bool | None = None
1480
+ purchaseType: str | None = None
1481
+ silent: bool | None = None
1482
+
1483
+
1484
+ @dataclass
1485
+ class SpellsClass:
1486
+ """SpellsClass content data."""
1487
+
1488
+ wizard: dict[str, SpellEntry]
1489
+ warrior: dict[str, SpellEntry]
1490
+ rogue: dict[str, SpellEntry]
1491
+ healer: dict[str, SpellEntry]
1492
+ special: dict[str, SpellEntry]
1493
+
1494
+
1495
+ @dataclass
1496
+ class CarTypes:
1497
+ """CarTypes content data."""
1498
+
1499
+ key: str
1500
+ messageOptions: int
1501
+ yearRound: bool = False
1502
+
1503
+
1504
+ @dataclass
1505
+ class SpecialItemEntry:
1506
+ """Item content data."""
1507
+
1508
+ key: str | None = None
1509
+ text: str | None = None
1510
+ notes: str | None = None
1511
+ immediateUse: bool | None = None
1512
+ limited: bool | None = None
1513
+ mana: int | None = None
1514
+ previousPurchase: bool | None = None
1515
+ purchaseType: str | None = None
1516
+ silent: bool | None = None
1517
+ target: str | None = None
1518
+ value: int | None = None
1519
+
1520
+
1521
+ @dataclass
1522
+ class EggEntry:
1523
+ """Egg content data."""
1524
+
1525
+ text: str | None = None
1526
+ mountText: str | None = None
1527
+ adjective: str | None = None
1528
+ value: int | None = None
1529
+ key: str | None = None
1530
+ notes: str | None = None
1531
+
1532
+
1533
+ @dataclass
1534
+ class HatchingPotionEntry:
1535
+ """Hatching potion content data."""
1536
+
1537
+ value: int | None = None
1538
+ key: str | None = None
1539
+ text: str | None = None
1540
+ notes: str | None = None
1541
+ premium: bool | None = None
1542
+ limited: bool | None = None
1543
+ _addlNotes: str | None = None
1544
+ wacky: bool | None = None
1545
+
1546
+
1547
+ @dataclass
1548
+ class PetEntry:
1549
+ """Pet content data."""
1550
+
1551
+ key: str | None = None
1552
+ Type: str | None = field(default=None, metadata=field_options(alias="type"))
1553
+ potion: str | None = None
1554
+ egg: str | None = None
1555
+ text: str | None = None
1556
+
1557
+
1558
+ @dataclass
1559
+ class InventoryItemEntry:
1560
+ """Inventory item content data."""
1561
+
1562
+ text: str | None = None
1563
+ textA: str | None = None
1564
+ textThe: str | None = None
1565
+ target: str | None = None
1566
+ value: int | None = None
1567
+ key: str | None = None
1568
+ notes: str | None = None
1569
+ canDrop: bool | None = None
1570
+
1571
+
1572
+ @dataclass
1573
+ class ContentData:
1574
+ """Content data."""
1575
+
1576
+ achievements: dict[str, AchievmentContent]
1577
+ questSeriesAchievements: dict[str, list[str]]
1578
+ animalColorAchievements: list[AnimalColorAchievementContent]
1579
+ animalSetAchievements: dict[str, AnimalSetAchievementContent]
1580
+ stableAchievements: dict[str, StableAchievementContent]
1581
+ petSetCompleteAchievs: list[PetSetCompleteAchievsContent]
1582
+ quests: dict[str, QuestsContent]
1583
+ questsByLevel: list[QuestsContent]
1584
+ userCanOwnQuestCategories: list[str]
1585
+ itemList: ItemListContent
1586
+ gear: GearContent
1587
+ spells: SpellsClass
1588
+ audioThemes: list[str]
1589
+ # mystery
1590
+ officialPinnedItems: list
1591
+ # bundles
1592
+ # potion
1593
+ # armoire
1594
+ # events
1595
+ # repeatingEvents
1596
+ classes: list[str]
1597
+ gearTypes: list[str]
1598
+ cardTypes: dict[str, CarTypes]
1599
+ special: dict[str, SpecialItemEntry]
1600
+ dropEggs: dict[str, EggEntry]
1601
+ questEggs: dict[str, EggEntry]
1602
+ eggs: dict[str, EggEntry]
1603
+ # timeTravelStable
1604
+ dropHatchingPotions: dict[str, HatchingPotionEntry]
1605
+ premiumHatchingPotions: dict[str, HatchingPotionEntry]
1606
+ wackyHatchingPotions: dict[str, HatchingPotionEntry]
1607
+ hatchingPotions: dict[str, HatchingPotionEntry]
1608
+ pets: dict[str, bool]
1609
+ premiumPets: dict[str, bool]
1610
+ questPets: dict[str, bool]
1611
+ specialPets: dict[str, str]
1612
+ wackyPets: dict[str, bool]
1613
+ petInfo: dict[str, PetEntry]
1614
+ mounts: dict[str, bool]
1615
+ premiumMounts: dict[str, bool]
1616
+ questMounts: dict[str, bool]
1617
+ specialMounts: dict[str, str]
1618
+ mountInfo: dict[str, PetEntry]
1619
+ food: dict[str, InventoryItemEntry]
1620
+ # appearances
1621
+ # backgrounds
1622
+ # backgroundsFlat
1623
+ # userDefaults
1624
+ # tasksByCategory
1625
+ # userDefaultsMobile
1626
+ # faq
1627
+ # loginIncentives
1628
+
1629
+
1630
+ @dataclass
1631
+ class HabiticaContentResponse(HabiticaResponse):
1632
+ """Representation of a content response."""
1633
+
1634
+ data: ContentData
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: Habiticalib
3
- Version: 0.2.0a1
3
+ Version: 0.2.0a2
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
@@ -0,0 +1,11 @@
1
+ habiticalib/__init__.py,sha256=qZEUcYA0WAyGbZAaRWU9GeqmsvvxLvnDEpBcMKkZMe0,1803
2
+ habiticalib/const.py,sha256=tzHXqReY73QDyYNn66aN7TIjGVsr0Wd-RhmxOTEefsA,626
3
+ habiticalib/exceptions.py,sha256=oVFCGbHkVn0UpIKIPZPzXfvzs9US4R05ebdEn6cOpqM,1350
4
+ habiticalib/helpers.py,sha256=IRZLYWkDVLI0iVBgBMmvZ6L83KCUl-CnzGhUR_tP6Fg,4576
5
+ habiticalib/lib.py,sha256=uPmuTRs5qRwE-RrHI0AFUsvEiZNT33XEW8uIgsgvaXQ,71339
6
+ habiticalib/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
+ habiticalib/types.py,sha256=zJq3jnZNUSU0p5XX_14PpGHmxmCeuf1F_YQjFpcoMLo,42341
8
+ habiticalib-0.2.0a2.dist-info/METADATA,sha256=7-vUpy2rTPBslylAnDnjL5iESd328b9g0tFfeT0_4-8,4156
9
+ habiticalib-0.2.0a2.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
10
+ habiticalib-0.2.0a2.dist-info/licenses/LICENSE,sha256=oIinIOSJ49l1iVIRI3XGXFWt6SF7a83kEFBAY8ORwNI,1084
11
+ habiticalib-0.2.0a2.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,,