-
Notifications
You must be signed in to change notification settings - Fork 3
Home
A simple (but complete) Yelp API implementation
Pure python implementation of a fully-functional Yelp API client.
Yelp http://www.yelp.com provides a localized businesses and user reviews directory.
Yelp API http://www.yelp.com/developers/documentation exposes some core functionality to search for businesses and reviews
based on various criteria.
Usage is pretty straightforward, based on the Yelp API documentation as well as inline code documentation. Example usage:
from yelp import ReviewSearchApi
results = ReviewSearchApi(client_key=<my_ywsid_key>).by_location("Mission, San Francisco CA")
rows = results["businesses"]
for row in rows:
print row["name"]
Note that you will need a YWSID (Yelp Web Services ID) to use the Yelp API. see http://www.yelp.com/developers/documentation/faq
- Supports the 3 published Yelp APIs: Review Search API, Phone API, Neighborhood API.
- Easily installable/distributable using setuptools/distutils
- Complete set of unit tests
- Based on the excellent httplib2 module
- Uses Python2.6 builtin json module for parsing or simplejson for pre-2.6.
- For python 2.6 and above, the only external dependency should be httplib2 - http://code.google.com/p/httplib2/.
- for 2.5 and below, http://pypi.python.org/pypi/simplejson/ simplejson will also be required.
- http://pypi.python.org/pypi/setuptools setuptools is recommended as it can fetch both automatically, but if that is not available, distutils will be used as a fallback.
Download the source distribution tar file, extract archive file, and type: python setup.py install thats it!
To run the unit-test suite enclosed, you have two options:
- If setuptools is available, you may simply run: python setup.py test
- Otherwise, you can run the test suite manually: python test_yelp.py
- Implement Business objects (no pun intended) to parse out Result (currently its simply the parsed raw JSON result set)
- See if any reason to use pickled python instead of json output format?
- Implement request timeout and standardized error handling (YelpException) for API requests
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.