Closed kennethreitz closed 11 months ago
@kennethreitz
Do you think we can also add manual Dict splashing (like adding an if type(params) is dict
then doing the same logic) for making things even simpler and more backward compatible?
The following 3 calls are equivalent:
>>> s = serpapi.search(q="Coffee", location="Austin, Texas, United States")
>>> params = {"q": "Coffee", "location": "Austin, Texas, United States"}
>>> s = serpapi.search(**params)
>>> s = serpapi.search(params)
Couple of SerpAPI
-> SerpApi
case typos.
@ritu1337 Can you do a proper review as your Python is way better than mine? Thank you.
@hartator I experimented with that, but didn't find an elegant solution. Something else is coming to mind now, though. I'll see what I can do.
Thanks again for the feedback, @hartator. Great suggestion. Found a good solution.
Follow-up PR is here: https://github.com/serpapi/serpapi-python/pull/5
Hello,
I decided to take a shot at implementing a new Python client based on this codebase, and I'm fairly happy with the results. While still a work in progress, if we can come to an agreement, I think this is a good time to merge my
kr-improvements
branch into themaster
branch (perhapsdev
is better?).Documentation has been uploaded to Read the Docs:
https://serpapi-python.readthedocs.io/en/latest/
This is a bit of a different approach than the one that was being taken.