Rename variety sprites to correct Pokémon IDs#198
Rename variety sprites to correct Pokémon IDs#198anhthang wants to merge 5 commits intoPokeAPI:masterfrom
Conversation
|
I’ve run the rename script on two folders so far: |
scripts/rename_pokemon_varieties.py
Outdated
| new_path = os.path.join(root, new_filename) | ||
|
|
||
| # Prevent overwriting if the file already exists | ||
| # if not os.path.exists(new_path): |
There was a problem hiding this comment.
Why is this part commented? When a file is already present we could simply delete the id-variant.png file.
There was a problem hiding this comment.
I commented this out so the file is always renamed, which lets me double-check any differences between the id-variant and the Pokémon ID. The id-variant file is always deleted.
There was a problem hiding this comment.
I think there should be a case when there is a id-<variant> and a new custom <id> (10000+) present we compare both the images if they are same either rename or delete but if its different we flag that somewhere
6734f32 to
6d3db1d
Compare
| data = response.json() | ||
| species_cache[pokedex_num] = data | ||
| return data | ||
| elif response.status_code == 429: |
There was a problem hiding this comment.
I dont think pokepai has ratelimits in place so this check can probably be skipped
|
@FallenDeity thanks for your suggestions, script updated |
This adds a script that renames variety PNG files (e.g. 877-hangry.png) to their correct Pokémon IDs by querying the Pokémon species endpoint and matching varieties by name.
Resolves #174.
First run against the official-artwork folder looks correct; I'll follow up with 2–3 other folders in this PRs and keep this minimal.