PokeAPI / pokebase

Python 3 wrapper for Pokéapi v2
BSD 3-Clause "New" or "Revised" License
286 stars 53 forks source link

Can't access any gen 9 information #46

Closed jemarq04 closed 1 year ago

jemarq04 commented 1 year ago

I can see all the information on the API itself, but for whatever reason when I try to access it with pokebase it doesn't seem to work. I've given an example below.

Python 3.11.4 (main, Jun 20 2023, 16:59:59) [Clang 14.0.3 (clang-1403.0.22.14.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pokebase as pb
>>> pb.generation(3).main_region.name
'hoenn'
>>> pb.generation(9).main_region.name
>>> 
>>> pb.pokemon("pikachu").height
4
>>> pb.pokemon("fuecoco").height
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.11/site-packages/pokebase/interface.py", line 117, in __getattr__
    raise AttributeError('{} object has no attribute {}'
AttributeError: <class 'pokebase.interface.APIResource'> object has no attribute height

However, I can find those pages in the API itself just fine. There is one for generation 9 (https://pokeapi.co/api/v2/generation/9/) and one for fuecoco (https://pokeapi.co/api/v2/pokemon/909/). Is there a reason I'm not able to access these resources? I've tried uninstalling and reinstalling pokebase.

Edit: It seems that pokemon introduces in Legends Arceus are also not present, as seen in another issue #40 .

jemarq04 commented 1 year ago

Ah, it seems to be because of the cache! I removed the cache found at ~/.cache/pokebase/ and found that now all the new information is able to be accessed without issue! If your cache is not there, you can find it by running

>>> from pokebase import cache
>>> cache.API_CACHE

in the python CLI.