localdex 0.1.4__py3-none-any.whl → 0.1.5__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 +8 -8
- {localdex-0.1.4.dist-info → localdex-0.1.5.dist-info}/METADATA +21 -9
- {localdex-0.1.4.dist-info → localdex-0.1.5.dist-info}/RECORD +6 -6
- {localdex-0.1.4.dist-info → localdex-0.1.5.dist-info}/WHEEL +0 -0
- {localdex-0.1.4.dist-info → localdex-0.1.5.dist-info}/entry_points.txt +0 -0
- {localdex-0.1.4.dist-info → localdex-0.1.5.dist-info}/top_level.txt +0 -0
localdex/core.py
CHANGED
@@ -422,11 +422,11 @@ class LocalDex:
|
|
422
422
|
base_stats_data = data.get("baseStats", {})
|
423
423
|
base_stats = BaseStats(
|
424
424
|
hp=base_stats_data.get("hp", 0),
|
425
|
-
attack=base_stats_data.get("atk", 0),
|
426
|
-
defense=base_stats_data.get("def", 0),
|
427
|
-
special_attack=base_stats_data.get("spa", 0),
|
428
|
-
special_defense=base_stats_data.get("spd", 0),
|
429
|
-
speed=base_stats_data.get("spe", 0)
|
425
|
+
attack=base_stats_data.get("attack", base_stats_data.get("atk", 0)),
|
426
|
+
defense=base_stats_data.get("defense", base_stats_data.get("def", 0)),
|
427
|
+
special_attack=base_stats_data.get("special_attack", base_stats_data.get("spa", 0)),
|
428
|
+
special_defense=base_stats_data.get("special_defense", base_stats_data.get("spd", 0)),
|
429
|
+
speed=base_stats_data.get("speed", base_stats_data.get("spe", 0))
|
430
430
|
)
|
431
431
|
|
432
432
|
# Create Pokemon object
|
@@ -501,9 +501,9 @@ class LocalDex:
|
|
501
501
|
"""Create an Ability object from raw data."""
|
502
502
|
return Ability(
|
503
503
|
name=data.get("name", ""),
|
504
|
-
description=data.get("desc"),
|
505
|
-
short_description=data.get("shortDesc"),
|
506
|
-
generation=data.get("gen"),
|
504
|
+
description=data.get("description", data.get("desc", "")),
|
505
|
+
short_description=data.get("short_description", data.get("shortDesc", "")),
|
506
|
+
generation=data.get("generation", data.get("gen")),
|
507
507
|
rating=data.get("rating"),
|
508
508
|
num=data.get("num"),
|
509
509
|
effect=data.get("effect"),
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: localdex
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.5
|
4
4
|
Summary: A local Pokemon data repository/Pokedex with fast offline access
|
5
5
|
Home-page: https://github.com/yourusername/localdex
|
6
6
|
Author: LocalDex Team
|
@@ -144,17 +144,29 @@ print(f"{pikachu.name} - {pikachu.types}")
|
|
144
144
|
charizard = dex.get_pokemon_by_id(6)
|
145
145
|
print(f"{charizard.name} - HP: {charizard.base_stats.hp}")
|
146
146
|
|
147
|
-
#
|
148
|
-
|
149
|
-
print(f"
|
147
|
+
# Get Pokemon stats
|
148
|
+
bulbasaur = dex.get_pokemon("bulbasaur")
|
149
|
+
print(f"{bulbasaur.name} - Attack: {bulbasaur.base_stats.attack}, Speed: {bulbasaur.base_stats.speed}")
|
150
150
|
|
151
151
|
# Get moves
|
152
152
|
thunderbolt = dex.get_move("thunderbolt")
|
153
|
-
print(f"{thunderbolt.name} - Power: {thunderbolt.base_power}")
|
154
|
-
|
155
|
-
# Get abilities
|
156
|
-
lightning_rod = dex.get_ability("
|
157
|
-
print(f"{lightning_rod.name} - {lightning_rod.
|
153
|
+
print(f"{thunderbolt.name} - Power: {thunderbolt.base_power}, Type: {thunderbolt.type}")
|
154
|
+
|
155
|
+
# Get abilities (note: use dashes in names like "lightning-rod")
|
156
|
+
lightning_rod = dex.get_ability("lightning-rod")
|
157
|
+
print(f"{lightning_rod.name} - {lightning_rod.short_description}")
|
158
|
+
|
159
|
+
# Get all Pokemon of a specific type (basic example)
|
160
|
+
all_pokemon = dex.get_all_pokemon()
|
161
|
+
fire_pokemon = [p for p in all_pokemon if "Fire" in p.types]
|
162
|
+
print(f"Fire type Pokemon count: {len(fire_pokemon)}")
|
163
|
+
print(f"First 5 Fire Pokemon: {[p.name for p in fire_pokemon[:5]]}")
|
164
|
+
|
165
|
+
# Get all moves of a specific type
|
166
|
+
all_moves = dex.get_all_moves()
|
167
|
+
electric_moves = [m for m in all_moves if m.type == "Electric"]
|
168
|
+
print(f"Electric moves count: {len(electric_moves)}")
|
169
|
+
print(f"First 5 Electric moves: {[m.name for m in electric_moves[:5]]}")
|
158
170
|
```
|
159
171
|
|
160
172
|
## API Reference
|
@@ -1,6 +1,6 @@
|
|
1
1
|
localdex/__init__.py,sha256=rAVSDHi5KVKNiMaKgZZ04_Kl7j2KPCZuWO7OuDU6id8,748
|
2
2
|
localdex/cli.py,sha256=79NpeQQYwuDuM6wODUX1AOUppTPULD5T0qgTH5uKd2c,16797
|
3
|
-
localdex/core.py,sha256=
|
3
|
+
localdex/core.py,sha256=zcaqiVKaeyKC9HKr5tXl2-nc30ZjRGVJlhZz5f2hwyY,20514
|
4
4
|
localdex/data_loader.py,sha256=hi9aSTto5Ti-OBGOgrQ-XwD5hmivsUwS1uC4rulhwQI,11366
|
5
5
|
localdex/download_data.py,sha256=ibAHDxL60sV4LVN9isCmf8vvd_aI9IQbyjJpU0FHGUo,18869
|
6
6
|
localdex/exceptions.py,sha256=Z02-8Kci6jFDk2nnGdVSHZJMDDWE9vuwuASs4VM3To8,2777
|
@@ -4790,8 +4790,8 @@ localdex/models/ability.py,sha256=AQzv3XUHHl4sustMJjPDDjJOjXu2GMLTfcM3-tqQ_1w,30
|
|
4790
4790
|
localdex/models/item.py,sha256=zXao8F-jBPUGq_YLeGeYeK_dZVI7aZMXtWOPwR3qusY,4677
|
4791
4791
|
localdex/models/move.py,sha256=hfgcWI4ziz5MMvc9ddmkotxzYYdrSUqZZQ72IU5tucs,7629
|
4792
4792
|
localdex/models/pokemon.py,sha256=v5zkxY1NGGR-MczFCZe9fHt6u_BAqAjMiQZlpcLXVGc,5408
|
4793
|
-
localdex-0.1.
|
4794
|
-
localdex-0.1.
|
4795
|
-
localdex-0.1.
|
4796
|
-
localdex-0.1.
|
4797
|
-
localdex-0.1.
|
4793
|
+
localdex-0.1.5.dist-info/METADATA,sha256=C7_VheiO7SvwVQVmijCJ1oVcAVfjUxZl9ZkgpbNHuoc,11767
|
4794
|
+
localdex-0.1.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
4795
|
+
localdex-0.1.5.dist-info/entry_points.txt,sha256=n5GxSeQo-MRuvrT2wVk7hOzEFFsWf6tkBjkzmGIYJe4,47
|
4796
|
+
localdex-0.1.5.dist-info/top_level.txt,sha256=vtupDMH-IaxVCoEZrmE0QzdTwhaKzngVJbTA1NkR_MY,9
|
4797
|
+
localdex-0.1.5.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|