localdex 0.3.0__py3-none-any.whl → 0.3.1__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/__init__.py +6 -0
- localdex/core.py +45 -4
- localdex/data/items/crystal-cluster.json +3 -0
- localdex/name_normalizer.py +12 -1
- localdex/stat_guesser.py +928 -0
- localdex-0.3.1.dist-info/METADATA +135 -0
- {localdex-0.3.0.dist-info → localdex-0.3.1.dist-info}/RECORD +11 -10
- localdex/data/items/cyrstal-cluster.json +0 -3
- localdex-0.3.0.dist-info/METADATA +0 -196
- {localdex-0.3.0.dist-info → localdex-0.3.1.dist-info}/WHEEL +0 -0
- {localdex-0.3.0.dist-info → localdex-0.3.1.dist-info}/entry_points.txt +0 -0
- {localdex-0.3.0.dist-info → localdex-0.3.1.dist-info}/licenses/LICENSE +0 -0
- {localdex-0.3.0.dist-info → localdex-0.3.1.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,135 @@
|
|
1
|
+
Metadata-Version: 2.4
|
2
|
+
Name: localdex
|
3
|
+
Version: 0.3.1
|
4
|
+
Summary: A local Pokemon data repository/Pokedex with fast offline access
|
5
|
+
Author-email: LocalDex Team <localdex@example.com>
|
6
|
+
License: MIT
|
7
|
+
Project-URL: Homepage, https://github.com/colefoster/localdex
|
8
|
+
Project-URL: Documentation, https://localdex.readthedocs.io/
|
9
|
+
Project-URL: Repository, https://github.com/colefoster/localdex
|
10
|
+
Project-URL: Bug Tracker, https://github.com/colefoster/localdex/issues
|
11
|
+
Classifier: Development Status :: 3 - Alpha
|
12
|
+
Classifier: Intended Audience :: Developers
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
14
|
+
Classifier: Programming Language :: Python :: 3.8
|
15
|
+
Classifier: Programming Language :: Python :: 3.9
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
19
|
+
Classifier: Topic :: Games/Entertainment
|
20
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
21
|
+
Requires-Python: >=3.8
|
22
|
+
Description-Content-Type: text/markdown
|
23
|
+
License-File: LICENSE
|
24
|
+
Requires-Dist: requests
|
25
|
+
Requires-Dist: typing-extensions
|
26
|
+
Provides-Extra: core
|
27
|
+
Provides-Extra: gen1
|
28
|
+
Provides-Extra: gen2
|
29
|
+
Provides-Extra: gen3
|
30
|
+
Provides-Extra: gen4
|
31
|
+
Provides-Extra: gen5
|
32
|
+
Provides-Extra: gen6
|
33
|
+
Provides-Extra: gen7
|
34
|
+
Provides-Extra: gen8
|
35
|
+
Provides-Extra: gen9
|
36
|
+
Provides-Extra: learnsets
|
37
|
+
Provides-Extra: items
|
38
|
+
Provides-Extra: abilities
|
39
|
+
Provides-Extra: full
|
40
|
+
Requires-Dist: localdex[abilities,gen1,gen2,gen3,gen4,gen5,gen6,gen7,gen8,gen9,items,learnsets]; extra == "full"
|
41
|
+
Provides-Extra: dev
|
42
|
+
Requires-Dist: pytest>=7.0.0; extra == "dev"
|
43
|
+
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
|
44
|
+
Requires-Dist: pytest-mock>=3.10.0; extra == "dev"
|
45
|
+
Requires-Dist: black>=22.0.0; extra == "dev"
|
46
|
+
Requires-Dist: isort>=5.0.0; extra == "dev"
|
47
|
+
Requires-Dist: mypy>=1.0.0; extra == "dev"
|
48
|
+
Requires-Dist: flake8>=5.0.0; extra == "dev"
|
49
|
+
Dynamic: license-file
|
50
|
+
|
51
|
+
# LocalDex
|
52
|
+
|
53
|
+
A local Pokemon data repository/Pokedex with fast offline access.
|
54
|
+
|
55
|
+
## Features
|
56
|
+
|
57
|
+
- Fast offline access to Pokemon data
|
58
|
+
- Comprehensive Pokemon information including stats, moves, abilities, and items
|
59
|
+
- Support for all Pokemon generations
|
60
|
+
- Easy-to-use Python API
|
61
|
+
- Command-line interface
|
62
|
+
- Extensible data loading system
|
63
|
+
|
64
|
+
## Installation
|
65
|
+
|
66
|
+
```bash
|
67
|
+
pip install localdex
|
68
|
+
```
|
69
|
+
|
70
|
+
For development installation:
|
71
|
+
```bash
|
72
|
+
pip install -e .
|
73
|
+
```
|
74
|
+
|
75
|
+
## Quick Start
|
76
|
+
|
77
|
+
```python
|
78
|
+
from localdex import LocalDex
|
79
|
+
|
80
|
+
# Initialize the Pokedex
|
81
|
+
dex = LocalDex()
|
82
|
+
|
83
|
+
# Get Pokemon by name
|
84
|
+
pikachu = dex.get_pokemon("Pikachu")
|
85
|
+
print(f"Pikachu's HP: {pikachu.base_stats.hp}")
|
86
|
+
|
87
|
+
# Get Pokemon by ID
|
88
|
+
charizard = dex.get_pokemon_by_id(6)
|
89
|
+
print(f"Charizard's type: {charizard.types}")
|
90
|
+
|
91
|
+
# Get move information
|
92
|
+
thunderbolt = dex.get_move("Thunderbolt")
|
93
|
+
print(f"Thunderbolt power: {thunderbolt.power}")
|
94
|
+
```
|
95
|
+
|
96
|
+
## Command Line Usage
|
97
|
+
|
98
|
+
```bash
|
99
|
+
# Get Pokemon information
|
100
|
+
localdex pokemon pikachu
|
101
|
+
|
102
|
+
# Get move information
|
103
|
+
localdex move thunderbolt
|
104
|
+
|
105
|
+
# Get ability information
|
106
|
+
localdex ability levitate
|
107
|
+
|
108
|
+
# Get item information
|
109
|
+
localdex item leftovers
|
110
|
+
```
|
111
|
+
|
112
|
+
## Development
|
113
|
+
|
114
|
+
### Running Tests
|
115
|
+
|
116
|
+
```bash
|
117
|
+
pytest
|
118
|
+
```
|
119
|
+
|
120
|
+
### Code Formatting
|
121
|
+
|
122
|
+
```bash
|
123
|
+
black localdex/
|
124
|
+
isort localdex/
|
125
|
+
```
|
126
|
+
|
127
|
+
### Type Checking
|
128
|
+
|
129
|
+
```bash
|
130
|
+
mypy localdex/
|
131
|
+
```
|
132
|
+
|
133
|
+
## License
|
134
|
+
|
135
|
+
MIT License - see LICENSE file for details.
|
@@ -1,11 +1,12 @@
|
|
1
|
-
localdex/__init__.py,sha256=
|
1
|
+
localdex/__init__.py,sha256=TOjRTwjpzKK7LS80bLEgQ_nDpxjHjI2XCjcr-lJ2ZWA,620
|
2
2
|
localdex/cli.py,sha256=WqBCyA0akAFJNrYa8jCA3zoZgYEptDYDMGfAGkvKyZc,19317
|
3
|
-
localdex/core.py,sha256=
|
3
|
+
localdex/core.py,sha256=gFaC4dpGjDv8UvVnje6Tn_92E6D0hC-9dDvN13AlbfI,22283
|
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
|
7
|
-
localdex/name_normalizer.py,sha256=
|
7
|
+
localdex/name_normalizer.py,sha256=aBpwnvBGLN_-MnpgMPbImnpmOwjIQzzHW2yPbqFNnOs,22051
|
8
8
|
localdex/stat_calculator.py,sha256=_hVxTUQKGnvVPTdmyBWSfVMdzRP82SeY0PWUXWSSXtI,34848
|
9
|
+
localdex/stat_guesser.py,sha256=ESW3rw6iyYEIplx-Hykd0GZKsJCp2ysKVV6rLw0yDkU,35525
|
9
10
|
localdex/data/abilities/adaptability.json,sha256=FGEEZmL80YVcIXHV-h287Wu-UJycM1QEJxiOHK2I4mY,289
|
10
11
|
localdex/data/abilities/aerilate.json,sha256=KRZOVH2KGdEQ_3UktFoXoagUOaC8jIPZ6Ti-YGzW44s,301
|
11
12
|
localdex/data/abilities/aftermath.json,sha256=Awv_8jquu3pM4CemD5ylS1v83ABrqGtrgMEkL-1ldBk,285
|
@@ -616,6 +617,7 @@ localdex/data/items/cream-cheese.json,sha256=9zUtllp4Jt07BeKNZp7tORG2ja7zhllKWbU
|
|
616
617
|
localdex/data/items/croagunk-poison.json,sha256=cV8jYRWKyGEtYZtKg5_aa_hZwAPF6wr14JlRknq-sUk,31
|
617
618
|
localdex/data/items/crown-pass.json,sha256=glzE4u2uBMYjYWcQhes4bxrk3hTSd8z_p8Y1vfj3-5g,129
|
618
619
|
localdex/data/items/cryogonal-ice.json,sha256=w4_Ojtnttgl-lZNwf_F9Hu7Uf7cwNv1fiRMvpSJD11o,29
|
620
|
+
localdex/data/items/crystal-cluster.json,sha256=BWBfxtt0iijxKjvbABQxms1iuv01HuIMoDxaFt5WfP4,31
|
619
621
|
localdex/data/items/cubchoo-fur.json,sha256=RuvZ1OeoGUBcWCfMkLkg_R3GFN8l-KtkrX7IvKm_FJY,27
|
620
622
|
localdex/data/items/cubone-candy.json,sha256=ofIAc5duH2vyh42pD6bcIK5zq4WvCmXGRtHG1C4iaBs,158
|
621
623
|
localdex/data/items/cucumber.json,sha256=cQP8Wch1pcmXRzHwLHSPxZEaAgJQspfVdkbyE0Kapj8,24
|
@@ -625,7 +627,6 @@ localdex/data/items/custap-berry.json,sha256=DieKeyKqxyoL_Kcj5Tk9V6U1yvMRUCje0WT
|
|
625
627
|
localdex/data/items/cutiefly-powder.json,sha256=cJeJGQFFhdiaermonhTXQuVFxIKLgdM_p3HikUeDAwQ,31
|
626
628
|
localdex/data/items/cyber-ball.json,sha256=J5otE307FWjow3q6j7ny-abBnrjBm6kwNEIWzBc5RFo,26
|
627
629
|
localdex/data/items/cyclizar-scales.json,sha256=Ny5A6Kv4TOS6AYJRjC5l15nCi2WVad8g2Rhlx2QYNK4,31
|
628
|
-
localdex/data/items/cyrstal-cluster.json,sha256=v3lwVB6Rwe1zxhPz4b0DHTeVcukFVEz9gPh-Inmr0AA,31
|
629
630
|
localdex/data/items/damp-mulch.json,sha256=eZGB5svJxP5tEFxK98WQaiE25yXYKBgiHbSDMk1sLMo,152
|
630
631
|
localdex/data/items/damp-rock.json,sha256=nmyBIDKoAyTssKt9oBj1gSSC8-vT5f6qLOkeXF3aWlQ,135
|
631
632
|
localdex/data/items/dark-gem.json,sha256=4GuDzf9VnkMGL06koKIc_DGOTCp26wZqkyXZN6U9jqs,146
|
@@ -4827,9 +4828,9 @@ localdex/models/ability.py,sha256=AQzv3XUHHl4sustMJjPDDjJOjXu2GMLTfcM3-tqQ_1w,30
|
|
4827
4828
|
localdex/models/item.py,sha256=zXao8F-jBPUGq_YLeGeYeK_dZVI7aZMXtWOPwR3qusY,4677
|
4828
4829
|
localdex/models/move.py,sha256=hfgcWI4ziz5MMvc9ddmkotxzYYdrSUqZZQ72IU5tucs,7629
|
4829
4830
|
localdex/models/pokemon.py,sha256=glnOiEhkFc25U54hJHwUkT-okUgtL2prg3269YXI3w0,5422
|
4830
|
-
localdex-0.3.
|
4831
|
-
localdex-0.3.
|
4832
|
-
localdex-0.3.
|
4833
|
-
localdex-0.3.
|
4834
|
-
localdex-0.3.
|
4835
|
-
localdex-0.3.
|
4831
|
+
localdex-0.3.1.dist-info/licenses/LICENSE,sha256=i6DyIs1YqXBAxAIiGBS6vp2iQP9tiMd47S8dvaeFmDQ,1065
|
4832
|
+
localdex-0.3.1.dist-info/METADATA,sha256=AJWmHrMwrNd5J3FsG-1f9E2qK7rQ5DL7i9v7CZ0MU5s,3215
|
4833
|
+
localdex-0.3.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
4834
|
+
localdex-0.3.1.dist-info/entry_points.txt,sha256=n5GxSeQo-MRuvrT2wVk7hOzEFFsWf6tkBjkzmGIYJe4,47
|
4835
|
+
localdex-0.3.1.dist-info/top_level.txt,sha256=vtupDMH-IaxVCoEZrmE0QzdTwhaKzngVJbTA1NkR_MY,9
|
4836
|
+
localdex-0.3.1.dist-info/RECORD,,
|
@@ -1,196 +0,0 @@
|
|
1
|
-
Metadata-Version: 2.4
|
2
|
-
Name: localdex
|
3
|
-
Version: 0.3.0
|
4
|
-
Summary: A local Pokemon data repository/Pokedex with fast offline access
|
5
|
-
Author-email: LocalDex Team <localdex@example.com>
|
6
|
-
License: MIT
|
7
|
-
Project-URL: Homepage, https://github.com/colefoster/localdex
|
8
|
-
Project-URL: Documentation, https://localdex.readthedocs.io/
|
9
|
-
Project-URL: Repository, https://github.com/colefoster/localdex
|
10
|
-
Project-URL: Bug Tracker, https://github.com/colefoster/localdex/issues
|
11
|
-
Classifier: Development Status :: 3 - Alpha
|
12
|
-
Classifier: Intended Audience :: Developers
|
13
|
-
Classifier: Programming Language :: Python :: 3
|
14
|
-
Classifier: Programming Language :: Python :: 3.8
|
15
|
-
Classifier: Programming Language :: Python :: 3.9
|
16
|
-
Classifier: Programming Language :: Python :: 3.10
|
17
|
-
Classifier: Programming Language :: Python :: 3.11
|
18
|
-
Classifier: Programming Language :: Python :: 3.12
|
19
|
-
Classifier: Topic :: Games/Entertainment
|
20
|
-
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
21
|
-
Requires-Python: >=3.8
|
22
|
-
Description-Content-Type: text/markdown
|
23
|
-
License-File: LICENSE
|
24
|
-
Requires-Dist: requests
|
25
|
-
Requires-Dist: typing-extensions
|
26
|
-
Provides-Extra: core
|
27
|
-
Provides-Extra: gen1
|
28
|
-
Provides-Extra: gen2
|
29
|
-
Provides-Extra: gen3
|
30
|
-
Provides-Extra: gen4
|
31
|
-
Provides-Extra: gen5
|
32
|
-
Provides-Extra: gen6
|
33
|
-
Provides-Extra: gen7
|
34
|
-
Provides-Extra: gen8
|
35
|
-
Provides-Extra: gen9
|
36
|
-
Provides-Extra: learnsets
|
37
|
-
Provides-Extra: items
|
38
|
-
Provides-Extra: abilities
|
39
|
-
Provides-Extra: full
|
40
|
-
Requires-Dist: localdex[abilities,gen1,gen2,gen3,gen4,gen5,gen6,gen7,gen8,gen9,items,learnsets]; extra == "full"
|
41
|
-
Provides-Extra: dev
|
42
|
-
Requires-Dist: pytest>=7.0.0; extra == "dev"
|
43
|
-
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
|
44
|
-
Requires-Dist: black>=22.0.0; extra == "dev"
|
45
|
-
Requires-Dist: isort>=5.0.0; extra == "dev"
|
46
|
-
Requires-Dist: mypy>=1.0.0; extra == "dev"
|
47
|
-
Requires-Dist: flake8>=5.0.0; extra == "dev"
|
48
|
-
Dynamic: license-file
|
49
|
-
|
50
|
-
# LocalDex
|
51
|
-
|
52
|
-
A fast, offline-first Python library for Pokemon data access. LocalDex provides comprehensive Pokemon information without requiring network requests.
|
53
|
-
|
54
|
-
[](https://badge.fury.io/py/localdex)
|
55
|
-
[](https://pypi.org/project/localdex/)
|
56
|
-
[](https://opensource.org/licenses/MIT)
|
57
|
-
|
58
|
-
## Features
|
59
|
-
|
60
|
-
- **Offline Access**: All data stored locally - no network requests required
|
61
|
-
- **Fast Lookups**: Optimized caching and search capabilities
|
62
|
-
- **Comprehensive Data**: Pokemon, moves, abilities, and items
|
63
|
-
- **CLI Interface**: Command-line access to all data
|
64
|
-
- **Type Hints**: Full type support for better development experience
|
65
|
-
- **Stat Calculations**: Built-in stat calculation methods
|
66
|
-
|
67
|
-
## Installation
|
68
|
-
|
69
|
-
```bash
|
70
|
-
pip install localdex
|
71
|
-
```
|
72
|
-
|
73
|
-
## Quick Start
|
74
|
-
|
75
|
-
```python
|
76
|
-
from localdex import LocalDex
|
77
|
-
|
78
|
-
# Initialize the dex
|
79
|
-
dex = LocalDex()
|
80
|
-
|
81
|
-
# Get Pokemon by name or ID
|
82
|
-
pikachu = dex.get_pokemon("pikachu")
|
83
|
-
charizard = dex.get_pokemon_by_id(6)
|
84
|
-
|
85
|
-
# Get moves and abilities
|
86
|
-
thunderbolt = dex.get_move("thunderbolt")
|
87
|
-
lightning_rod = dex.get_ability("lightning-rod")
|
88
|
-
|
89
|
-
# Search Pokemon
|
90
|
-
fire_types = dex.search_pokemon(type="fire")
|
91
|
-
fast_pokemon = dex.search_pokemon(min_speed=120)
|
92
|
-
legendary_fire = dex.search_pokemon(type="fire", is_legendary=True)
|
93
|
-
|
94
|
-
# Get all data
|
95
|
-
all_pokemon = dex.get_all_pokemon()
|
96
|
-
all_moves = dex.get_all_moves()
|
97
|
-
```
|
98
|
-
|
99
|
-
## CLI Usage
|
100
|
-
|
101
|
-
```bash
|
102
|
-
# Get Pokemon information
|
103
|
-
localdex pokemon pikachu
|
104
|
-
localdex pokemon 25
|
105
|
-
|
106
|
-
# Search Pokemon
|
107
|
-
localdex search --type Fire --generation 1
|
108
|
-
localdex search --legendary --min-attack 100
|
109
|
-
|
110
|
-
# Get move and ability info
|
111
|
-
localdex move thunderbolt
|
112
|
-
localdex ability lightningrod
|
113
|
-
|
114
|
-
# List data
|
115
|
-
localdex list-pokemon --generation 1
|
116
|
-
localdex list-moves --type Electric
|
117
|
-
|
118
|
-
# Export data
|
119
|
-
localdex export --format json --output pokemon_data.json
|
120
|
-
|
121
|
-
# Run demo
|
122
|
-
localdex demo
|
123
|
-
```
|
124
|
-
|
125
|
-
## API Reference
|
126
|
-
|
127
|
-
### Core Methods
|
128
|
-
|
129
|
-
- `get_pokemon(name_or_id)` - Get Pokemon by name or ID
|
130
|
-
- `get_pokemon_by_id(id)` - Get Pokemon by ID
|
131
|
-
- `get_pokemon_by_name(name)` - Get Pokemon by name
|
132
|
-
- `get_move(name)` - Get move by name
|
133
|
-
- `get_ability(name)` - Get ability by name
|
134
|
-
- `get_item(name)` - Get item by name
|
135
|
-
- `search_pokemon(**filters)` - Search Pokemon with filters
|
136
|
-
- `get_all_pokemon()` - Get all Pokemon
|
137
|
-
- `get_all_moves()` - Get all moves
|
138
|
-
- `get_all_abilities()` - Get all abilities
|
139
|
-
- `get_all_items()` - Get all items
|
140
|
-
|
141
|
-
### Search Filters
|
142
|
-
|
143
|
-
```python
|
144
|
-
# Available filters for search_pokemon()
|
145
|
-
dex.search_pokemon(
|
146
|
-
type="Fire", # Pokemon type
|
147
|
-
generation=1, # Generation number
|
148
|
-
is_legendary=True, # Legendary Pokemon
|
149
|
-
is_mythical=True, # Mythical Pokemon
|
150
|
-
min_attack=100, # Minimum attack stat
|
151
|
-
max_speed=50, # Maximum speed stat
|
152
|
-
name_contains="char" # Name contains text
|
153
|
-
)
|
154
|
-
```
|
155
|
-
|
156
|
-
### Data Models
|
157
|
-
|
158
|
-
```python
|
159
|
-
# Pokemon model
|
160
|
-
pokemon = dex.get_pokemon("pikachu")
|
161
|
-
print(f"{pokemon.name} - {pokemon.types}")
|
162
|
-
print(f"HP: {pokemon.base_stats.hp}")
|
163
|
-
print(f"Attack: {pokemon.base_stats.attack}")
|
164
|
-
|
165
|
-
# Move model
|
166
|
-
move = dex.get_move("thunderbolt")
|
167
|
-
print(f"{move.name} - Power: {move.base_power}, Type: {move.type}")
|
168
|
-
|
169
|
-
# Ability model
|
170
|
-
ability = dex.get_ability("lightning-rod")
|
171
|
-
print(f"{ability.name} - {ability.description}")
|
172
|
-
```
|
173
|
-
|
174
|
-
## Stat Calculations
|
175
|
-
|
176
|
-
LocalDex includes methods for calculating Pokemon stats:
|
177
|
-
|
178
|
-
```python
|
179
|
-
# Calculate stats with IVs, EVs, and level
|
180
|
-
hp = dex.get_hp_stat_from_species("pikachu", iv=31, ev=252, level=100)
|
181
|
-
attack = dex.get_attack_stat_from_species("pikachu", iv=31, ev=252, level=100)
|
182
|
-
|
183
|
-
# Generic stat calculation
|
184
|
-
hp = dex.calculate_hp(base=35, iv=31, ev=252, level=100)
|
185
|
-
attack = dex.calculate_other_stat(base=55, iv=31, ev=252, level=100, nature_modifier=1.1)
|
186
|
-
```
|
187
|
-
|
188
|
-
## License
|
189
|
-
|
190
|
-
MIT License - see [LICENSE](LICENSE) file for details.
|
191
|
-
|
192
|
-
## Data Sources
|
193
|
-
|
194
|
-
Data sourced from [Pokemon Showdown](https://github.com/smogon/pokemon-showdown) and [PokeAPI](https://pokeapi.co/).
|
195
|
-
|
196
|
-
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|