twitchtv / igdb-api-python

Python wrapper for IGDB API version 4
MIT License
74 stars 9 forks source link

Latest release is missing protocol buffer classes #29

Closed JonathanBrenner closed 1 year ago

JonathanBrenner commented 1 year ago

If you run the sample code in the README, it doesn't work as of the latest version (0.2.0).

byte_array = wrapper.api_request(
            'games',
            'fields id, name; offset 0; where platforms=48;'
          )

from igdb.igdbapi_pb2 import GameResult
byte_array = wrapper.api_request(
            'games.pb', # Note the '.pb' suffix at the endpoint
            'fields id, name; offset 0; where platforms=48;'
          )
games_message = GameResult()
games_message.ParseFromString(byte_array)

I get this error: ImportError: cannot import name 'GameResult' from 'igdb.igdbapi_pb2' (.../venv/lib/python3.11/site-packages/igdb/igdbapi_pb2.py)

I looked at the latest version of igdbapi_pb2.py and it looks like the class definitions were removed in the most recent change.

If I'm missing something, please let me know!

JonathanBrenner commented 1 year ago

After more debugging, I realize there was a typo difference between my code and the sample code. This is a non-issue!