Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can get basic example working #28

Open
palmerj opened this issue May 26, 2023 · 2 comments
Open

Can get basic example working #28

palmerj opened this issue May 26, 2023 · 2 comments

Comments

@palmerj
Copy link

palmerj commented May 26, 2023

I'm on MacOS Apple silicon and have installed from pip:

igdb-api-v4 0.2.0

from igdb.wrapper import IGDBWrapper
from igdb.igdbapi_pb2 import GameResult

wrapper = IGDBWrapper("client", "secret")

byte_array = wrapper.api_request(
    'games',
    'fields name; where id = 1942;'
)

games_message = GameResult()
games_message.ParseFromString(byte_array)

# Print the results
for game in games_message:
    print(game['name'])

returns:

Traceback (most recent call last):
File "/Users/xxxx/Developer/Personal/igdb/metadata.py", line 12, in
games_message.ParseFromString(byte_array)
google.protobuf.message.DecodeError: Error parsing message

@ybn4aq
Copy link

ybn4aq commented Nov 27, 2023

I am having the same issue. I would love to find a solution for this.

@ybn4aq
Copy link

ybn4aq commented Nov 28, 2023

Okay, interestingly enough I got it to work, but I had to change change some of the underlying protobuf python files because they weren't including the MutableMapping iterable from collections.abc--they were just importing it from collections. So I had to go through and manually change all mentions of collections to collections.abc. Super bizarre, maybe the Google protobuf python library is out of date.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants