Py3.12 compat & improved API surface #54
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I'll be completely honest, this is mostly AI generated and untested except for the
keyword_search
andproduct_details
endpoints, which work great. Based on #51.The upstream API is not great in that it doesn't allow passing the secrets and id as parameters, or specifying how to store the client credentials. I'm not going to say the this PR's API is ideal in that regard either, I'd much rather have a class dedicated to the storage strategy so the API client can store the data however they want, for example in a database.
Usage example, including local caching so that I don't repeatedly hit the API with the same queries: