localdex 0.2.22__py3-none-any.whl → 0.2.23__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.
- localdex/core.py +15 -31
- {localdex-0.2.22.dist-info → localdex-0.2.23.dist-info}/METADATA +1 -1
- {localdex-0.2.22.dist-info → localdex-0.2.23.dist-info}/RECORD +6 -6
- {localdex-0.2.22.dist-info → localdex-0.2.23.dist-info}/WHEEL +0 -0
- {localdex-0.2.22.dist-info → localdex-0.2.23.dist-info}/entry_points.txt +0 -0
- {localdex-0.2.22.dist-info → localdex-0.2.23.dist-info}/top_level.txt +0 -0
localdex/core.py
CHANGED
@@ -426,54 +426,38 @@ class LocalDex:
|
|
426
426
|
base_stats_data = data.get("baseStats", {})
|
427
427
|
base_stats = BaseStats(
|
428
428
|
hp=base_stats_data.get("hp", 0),
|
429
|
-
attack=base_stats_data.get("attack",
|
430
|
-
defense=base_stats_data.get("defense",
|
431
|
-
special_attack=base_stats_data.get("
|
432
|
-
special_defense=base_stats_data.get("
|
433
|
-
speed=base_stats_data.get("speed",
|
429
|
+
attack=base_stats_data.get("attack", 0),
|
430
|
+
defense=base_stats_data.get("defense", 0),
|
431
|
+
special_attack=base_stats_data.get("special-attack", 0),
|
432
|
+
special_defense=base_stats_data.get("special-defense", 0),
|
433
|
+
speed=base_stats_data.get("speed", 0),
|
434
434
|
)
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
id=data.get("id", 0),
|
439
|
-
name=data.get("name", ""),
|
435
|
+
return Pokemon(
|
436
|
+
id=data["id"],
|
437
|
+
name=data["name"],
|
440
438
|
types=data.get("types", []),
|
441
439
|
base_stats=base_stats,
|
442
440
|
height=data.get("height"),
|
443
441
|
weight=data.get("weight"),
|
444
442
|
color=data.get("color"),
|
445
|
-
|
443
|
+
abilities=data.get("abilities", {}),
|
444
|
+
moves=data.get("moves", []),
|
445
|
+
learnset=data.get("learnset", {}),
|
446
|
+
evolutions=data.get("evolutions", []),
|
446
447
|
prevo=data.get("prevo"),
|
447
448
|
evo_level=data.get("evoLevel"),
|
448
449
|
evo_type=data.get("evoType"),
|
449
450
|
evo_condition=data.get("evoCondition"),
|
450
451
|
evo_item=data.get("evoItem"),
|
451
|
-
egg_groups=data.get("eggGroups"),
|
452
|
-
gender_ratio=data.get("genderRatio"),
|
452
|
+
egg_groups=data.get("eggGroups", []),
|
453
|
+
gender_ratio=data.get("genderRatio", {}),
|
453
454
|
generation=data.get("generation"),
|
454
455
|
description=data.get("description"),
|
455
456
|
is_legendary=data.get("isLegendary", False),
|
456
457
|
is_mythical=data.get("isMythical", False),
|
457
458
|
is_ultra_beast=data.get("isUltraBeast", False),
|
458
|
-
|
459
|
-
metadata=data
|
459
|
+
metadata=data.get("metadata", {}),
|
460
460
|
)
|
461
|
-
|
462
|
-
# Add abilities
|
463
|
-
abilities_data = data.get("abilities", {})
|
464
|
-
for slot, ability_data in abilities_data.items():
|
465
|
-
if isinstance(ability_data, dict) and "data" in ability_data:
|
466
|
-
ability = self._create_ability_from_data(ability_data["data"])
|
467
|
-
pokemon.abilities[slot] = ability
|
468
|
-
|
469
|
-
# Add moves
|
470
|
-
moves_data = data.get("moves", [])
|
471
|
-
for move_data in moves_data:
|
472
|
-
if isinstance(move_data, dict):
|
473
|
-
move = self._create_move_from_data(move_data)
|
474
|
-
pokemon.moves.append(move)
|
475
|
-
|
476
|
-
return pokemon
|
477
461
|
|
478
462
|
def _create_move_from_data(self, data: Dict[str, Any]) -> Move:
|
479
463
|
"""Create a Move object from raw data."""
|
@@ -1,6 +1,6 @@
|
|
1
1
|
localdex/__init__.py,sha256=TTeh9Eys8nLtcw7Dg2equDqnouthIUyfsqvABtzR2vA,403
|
2
2
|
localdex/cli.py,sha256=WqBCyA0akAFJNrYa8jCA3zoZgYEptDYDMGfAGkvKyZc,19317
|
3
|
-
localdex/core.py,sha256=
|
3
|
+
localdex/core.py,sha256=xqRe-_ho-A1EDykin5CwlArUo-S6vKgRMMqi-Aikyq0,20176
|
4
4
|
localdex/data_loader.py,sha256=hi9aSTto5Ti-OBGOgrQ-XwD5hmivsUwS1uC4rulhwQI,11366
|
5
5
|
localdex/download_data.py,sha256=T4A3OliGe2RsrRV1glyCqRcFhQIRt29KcY1K1-IqTuU,21597
|
6
6
|
localdex/exceptions.py,sha256=Z02-8Kci6jFDk2nnGdVSHZJMDDWE9vuwuASs4VM3To8,2777
|
@@ -4825,8 +4825,8 @@ localdex/models/ability.py,sha256=AQzv3XUHHl4sustMJjPDDjJOjXu2GMLTfcM3-tqQ_1w,30
|
|
4825
4825
|
localdex/models/item.py,sha256=zXao8F-jBPUGq_YLeGeYeK_dZVI7aZMXtWOPwR3qusY,4677
|
4826
4826
|
localdex/models/move.py,sha256=hfgcWI4ziz5MMvc9ddmkotxzYYdrSUqZZQ72IU5tucs,7629
|
4827
4827
|
localdex/models/pokemon.py,sha256=glnOiEhkFc25U54hJHwUkT-okUgtL2prg3269YXI3w0,5422
|
4828
|
-
localdex-0.2.
|
4829
|
-
localdex-0.2.
|
4830
|
-
localdex-0.2.
|
4831
|
-
localdex-0.2.
|
4832
|
-
localdex-0.2.
|
4828
|
+
localdex-0.2.23.dist-info/METADATA,sha256=oJd4ITfg7GWuoRJH158nOnUJCmnTrTgrvWPZKFcjefs,8016
|
4829
|
+
localdex-0.2.23.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
4830
|
+
localdex-0.2.23.dist-info/entry_points.txt,sha256=n5GxSeQo-MRuvrT2wVk7hOzEFFsWf6tkBjkzmGIYJe4,47
|
4831
|
+
localdex-0.2.23.dist-info/top_level.txt,sha256=vtupDMH-IaxVCoEZrmE0QzdTwhaKzngVJbTA1NkR_MY,9
|
4832
|
+
localdex-0.2.23.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|