-
Notifications
You must be signed in to change notification settings - Fork 9
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
Added another code example to the readme #35
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: I am not a maintainer here, just a user and casual contributor of this package.
@@ -68,6 +68,19 @@ games_message.ParseFromString(byte_array) # Fills the protobuf message object wi | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
@@ -68,6 +68,19 @@ games_message.ParseFromString(byte_array) # Fills the protobuf message object wi | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
``` | |
```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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.