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

[apis] How do we return results? #37

Open
Clam- opened this issue Dec 6, 2014 · 2 comments
Open

[apis] How do we return results? #37

Clam- opened this issue Dec 6, 2014 · 2 comments

Comments

@Clam-
Copy link
Owner

Clam- commented Dec 6, 2014

For example in the googleapis.py module, I've been returning results as tuples just containing the fields I've been needing to use in the actual modules that use those apis.
Should we actually be returning the JSON dictionaries in full? (probably. I've done it with youtube helper method.)

@gkistler
Copy link
Collaborator

Something I've been partial to lately when dealing with situations like this is to perform the preprocessing in the api method (like what we're doing in google_image ) then return something like (formatted_results_tuple, json_response). That way it's convenient for the basic use case and the full json data is available if you want it.

Alternatively we could split the actual json snagging to its own _json methods and provide those if someone wants full response?

@Clam-
Copy link
Owner Author

Clam- commented Aug 10, 2016

That's a good idea. Either one is good I think I've seen the former one in some other APIs.

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

No branches or pull requests

2 participants