PokeAPI / pokebase

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

Cant get the 'back' sprite using back = True attribute #20

Closed siddhantchimankar closed 4 years ago

Naramsim commented 4 years ago

Can you post an example of the code that does not work?

Maybe that particular pokemon doesn't have a back sprite

thicco-catto commented 4 years ago

It doesn't seem to work for me either, neither the back sprite or any other keyword like "female" or "official-artwork"

import pokebase as pb

s3 = pb.SpriteResource('pokemon', 1, back=True)

What i get from this:

TypeError: __init__() got an unexpected keyword argument 'back'

Edit: You can get these sprites using

p = pb.pokemon_sprite("back/1")

But you still have to create those folders manually.

Naramsim commented 4 years ago

Hm, thanks for reporting. Pinging @GregHilmes

GregHilmes commented 4 years ago

Apparently I never did a release with the sprite improvements :thinking: (sorry about that - I'm astounded this has gone unnoticed since 2017). I'll take a look at the discrepancies between the current state of the repo and the PyPI release. The good news is that master has this bug fixed. If you need a quick fix, you can try to uninstall pokebase and reinstall with something like pip install git+https://github.com/PokeAPI/pokebase.git for the time being, although in all honesty its been so long since I touched this code I'm not sure if that will be stable.

The long-term fix will be to actually create a release with the current state of master, though I will take some time to make sure it is stable before doing so. (I'll close this once that release happens)

Naramsim commented 4 years ago

Thanks Greg! You could also set up a trigger in Travis that pushes onto Pypi when the master is pushed.

Anyway, you are the admin of the Pypi project :)