Added another code example to the readme#35
Conversation
ReenigneArcher
left a comment
There was a problem hiding this comment.
Note: I am not a maintainer here, just a user and casual contributor of this package.
| games = games_message.games | ||
| ``` | ||
|
|
||
| Note that depending on what type of query you're doing, you will need to parse it differently. Consider the following example of getting covers with a Protobuf API request: |
There was a problem hiding this comment.
| Note that depending on what type of query you're doing, you will need to parse it differently. Consider the following example of getting covers with a Protobuf API request: | |
| > **Note** | |
| > Depending on what type of query you're doing, you will need to parse it differently. | |
| > Consider the following example of getting covers with a Protobuf API request. |
| ``` | ||
|
|
||
| Note that depending on what type of query you're doing, you will need to parse it differently. Consider the following example of getting covers with a Protobuf API request: | ||
| ``` |
There was a problem hiding this comment.
| ``` | |
| ```py |
| covers_message.ParseFromString(byte_array) | ||
| covers = [cover.url for cover in covers_message.covers] | ||
| ``` | ||
| You may need to do some digging around in igdbapi_pb2.py (being careful not to actually edit anything) to look for similar functions to GameResult() and CoverResult() based on what you are trying to query for. |
There was a problem hiding this comment.
I'm not sure the final sentence is necessary or valuable. It is quite common to have to look through source code of various packages, especially ones that aren't so popular such as this one.
There was a problem hiding this comment.
I didn't know that this was necessary, especially considering my Python linter in VS Code did not pick up on GameResult() or CoverResult().
There was a problem hiding this comment.
Yea, I don't think any IDE would pick those up because of how they're added to the python globals.
As a beginner to this wrapper and the API, I found the lack of documentation for using this API in Python to be very anti-beginner friendly, so I decided to add another use case example to the readme.