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:

  1. Present the user with some subset from the list of available categories (see yelp.get_categories for the complete list).
  2. Ask the user to select one or more categories and store their selections and store them in the user_selections dictionary.
  3. 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:

  1. Retrieve the restaurants, and allow the user to specify a location before executing the search.
  2. Show the retrieved restaurants on the GUI in some coherent format.

Given the matched restaurants:

  1. Allow the user to preview an individual restaurant
  2. This should include (a) more detail about the restaurant, and (b) some reviews of the restaurant.
  3. Use the yelp.get_businesses and yelp.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
  • App handles errors (incorrect inputs). (Note: this applies anywhere you ask the user for input)
  • App prompts the user for their input in various ways
  • App honors user requests
  • App does not exit unless user asks to quit
Category selection 8 points
  • Displays the user's selected categories(s) on the main menu
  • Displays the available Yelp categories from which to choose in either the Textbox or Popup Window.
  • Allows user to select among categories
  • Allows user to clear out selected categories and start over
Ordering/Sorting Criteria 4 points
  • Allows user to specify their preferred ordering criteria (best_match, rating, review_count, distance)
  • Displays the selected ordering criteria on the main menu
Previewing matching restaurants 8 points
  • Allows the user to specify a location
  • Results honor user’s selected location, categories, and sorting criteria
  • Shows the matching restaurants to the GUI textbox in some coherent format
Previewing individual restaurant 8 points
  • Allows user to preview an individual restaurant via the GUI Textbox
  • Includes detail about restaurant
  • Includes restaurant reviews
Sends email 3 points
  • Successfully emails a restaurant recommendation and its reviews to a user in either a readable plain text format or in the provided HTML format.
Code Quality 3 points
  • All functions, variables, and file_names have mnemonic names / are snake case (up to -2 points)
  • Code is organized and without unused or redundant code. Please remove commented out code that isn’t running (to help our graders) (up to -3 points)
Video 1 point
  • Your video clearly demonstrates the features you implemented
Extra credit Up to 5 points
  • Students completed various EC options according to the specifications above.

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.

🙏 I promise I've read the instructions and am ready to download! 🙏
Project Starter Files