yelpapi is a pure Python implementation of the Yelp v2.0 API.
Python
Latest commit 8973c5a Jun 14, 2016 @gfairchild fixing spelling mistake

README.md

yelpapi

AUTHOR

Geoffrey Fairchild

LICENSE

This software is licensed under the BSD 3-Clause License. Please refer to the separate LICENSE.txt file for the exact text of the license. You are obligated to give attribution if you use this code.

ABOUT

yelpapi is a pure Python implementation of the Yelp v2.0 API. It is simple, fast, and robust to any changes Yelp may make to the API in the future.

REQUIREMENTS

This code requires Python 2.7 or higher and requests_oauthlib.

INSTALL

yelpapi is available on PyPI at https://pypi.python.org/pypi/yelpapi.

Install using pip:

pip install yelpapi

Install from source:

python setup.py install

USING THIS CODE

This API is demonstrated more thoroughly in examples.py, but the basic idea is very simple:

from yelpapi import YelpAPI
yelp_api = YelpAPI(consumer_key, consumer_secret, token, token_secret)
search_results = yelp_api.search_query(args)
business_results = yelp_api.business_query(id=business_id, other_args)
phone_search_results = yelp_api.phone_search_query(phone=phone_number, other_args)

args and other_args are parameters that come directly from Yelp's Search API documentation, Business API documentation, and Phone Search API documentation. You only provide parameters you care about.

DIFFERENCES

Yelp v2.0 Python implementations:

yelpapi differs from other implementations in that it is completely dynamic with respect to both the input provided by the programmer and the output provided by Yelp. Most other implementations return the results as instances of pre-defined classes, while yelpapi returns a simply-defined, dynamically-generated dict. The benefit here is much smaller and simpler API implementation (the entire implementation is only 107 lines, including comments and whitespace!) as well as preparedness for any changes Yelp may make to the API in the future.