Yelp Docs | GUI Docs | Twilio Docs |
For this option, you are going to use the Yelp API to create a restaurant recommendation system. I have created a yelp
module for you, located in the apis folder to help you. All of the apis/yelp.py
functions have been documented here. Here is a video of how your program might work:
Note: this is only one way of implementing this program. Feel free to do it your way!
Please implement the following required features of your restaurant recommendation system (we encourage you to start with the restaurant_finder.py
template):
1. Allow the user to select among the Yelp restaurant categories
You will give the user the option of selecting one or more restaurant categories that can be used to filter the restaurants. To do this you will do the following:
- Present the user with some subset from the list of available categories (see
yelp.get_categories
for the complete list). - Ask the user to select one or more categories and store their selections and store them in the
user_selections
dictionary. - Proved the user with a way to either clear out or update their selected categories.
These actions must happen when the user clicks on the Select Categories
button in the GUI.
2. Allow the user to set the sorting criteria
How results are ordered really matters in search. Yelp allows 4 different options for sorting results: best_match
, rating
, review_count
, distance
. Given this, the user should be able to select how they want their results to be filtered.
These actions must happen when the user clicks on the Sort By
button in the GUI.
3. Allow user to view restaurants that match the selection criteria at a given location
Given the user’s selected categories and sorting criteria:
- Retrieve the restaurants, and allow the user to specify a location before executing the search.
- Show the retrieved restaurants on the GUI in some coherent format.
Given the matched restaurants:
- Allow the user to preview an individual restaurant
- This should include (a) more detail about the restaurant, and (b) some reviews of the restaurant.
- Use the
yelp.get_businesses
andyelp.get_reviews
helper functions to help you.
After the user has previewed a restaurant, ask them if they want to email the restaurant recommendation so someone. If so, email them a link to the restaurant and some details about it (including some reviews). Use the twilio.send_email
function to help you.
Your email needs to be readable. You can either design a custom email or use the to_html
option of the yelp.generate_business_table
function.
These actions must happen when the user clicks on the Discover Restaurants
button in the GUI.
Extra Credit Options (Up to 5 Points)
[2 Points] Allow the user to add an additional search term
You will give the user the option to specify an additional search term for their query (e.g. hamburgers
) to further narrow in on particular businesses.
[3 Points] Allow the user to set the price filters
You will give the user the option of selecting one or more price filters. The way the filters work: 1=$
, 2=$$
, 3=$$$
, and 4=$$$$
. So, if I only wanted to see $ and $$, my price filter would be: price_filter=1,2. Given this, the user should be able to select one or more price filters, and clear out their price filters if they want.
[2 Points] Allow the user to filter by restaurants that are “open now”
Enhance your program by also giving the user the option of specifying only restaurants which are currently open.
[3 Points] Allow the user to filter by restaurants that are “hot and new”
Enhance your program by also giving the user the option of specifying only restaurants which are “hot and new.” See the Yelp documentation (link updated) for more info. (Look under the attributes argument)
[5 Points] Incorporate another information source
In addition to searching Yelp, try to integrate data from Spotify as well! Maybe generate a playlist that fits the theme of the restaurant!
Rubric (40 Possible Points)
Note: In this project, all display / input should be done through the GUI. We won’t accept any results printed to the Interpreter Window.
Feature | Points | Scoring Guidelines |
---|---|---|
Main Program | 5 points |
|
Category selection | 8 points |
|
Ordering/Sorting Criteria | 4 points |
|
Previewing matching restaurants | 8 points |
|
Previewing individual restaurant | 8 points |
|
Sends email | 3 points |
|
Code Quality | 3 points |
|
Video | 1 point |
|
Extra credit | Up to 5 points |
|
Template Files
There are a lot of files you need for Project 2 so instead of having you download them one-by-one we’ve compressed them into a ZIP file for you. This means that after you download them, there’s an extra step to get them ready to be used:
Mac Users
For Mac users, the ZIP file that is downloaded will either be automatically extracted into a folder, or you can simply double click on the ZIP file to extract it (turn it into a regular folder). Then you can open any of the .py
files by double clicking on the file which will cause it to open in IDLE.
Windows Users
If you’re on a Windows machine, there’s a few extra steps for both of these processes.
To extract a ZIP file, you can follow those instructions here. Note: you must extract these files first in order to use them in IDLE. Otherwise, it will say “read-only” and you will not be able to run or edit the files.
Please read through the assignment text BEFORE downloading the template files. Once you've read through, click the button below.