For the second project, we want you to apply what you've learned to build a program that searches, filters, and displays data. Because much of what programmers do involves manipulating and making sense of data for many different purposes — from scienc

computer science

Description

EECS 110: Project 2

Working with Networked Data


For the second project, we want you to apply what you've learned to build a program that searches, filters, and displays data. Because much of what programmers do involves manipulating and making sense of data for many different purposes — from science to investigative journalism, to civic decision-making (and advocacy) — this will likely be a skill that many of you will leverage in the future if you do any kind of data analytics. Moreover, even beyond computer programming, having a more in-depth understanding of how these systems are designed and how they interconnect with one another is relevant to all of us. 

Please start on this assignment early: like with anything, you’ll get out of it what you put into it. You are also welcome to collaborate in groups of 2 or 3. If you do so, you must still submit your own copy of your code, and list who you collaborated with in the submission comments (so that when we run our code similarity checker, we don’t flag you and your collaborators).

PROJECT OVERVIEW

For this project you will:

  1. Install sendgrid (on the command line), which is an email library:
    pip install sendgrid

  2. Download the starter files.

  3. Modify the authentication.py file (inside of the apis folder) and add the course API key. To do this: 

    1. Navigate to Canvas > Assignments > Project 2

    2. Replace lines 8-16 of apis/authentication.py with the following line:
      API_TUTOR_TOKEN = 'API_TOKEN_ON_CANVAS_ASSIGNMENT_PAGE'

  4. Pick one of two themes: music (Spotify) or food (Yelp)

  5. Get oriented with the relevant helper modules apis.yelp, apis.spotify, apis.sendgrid that will help you interact with the data provider

  6. Fulfill the requirements of the assignment

  7. Earn up to 10 points extra credit by completing optional enhancements

IMPORTANT BACKGROUND INFORMATION

We will be using a number of web data services to complete this assignment. As such, you will be using API keys (kind of like passwords) that I pay for and manage. Please only use these keys for the course assignments. While it is certainly possible to use my sendgrid key to create a spam bot that will get me banned from Sendgrid forever, please don’t. I am trusting you. If you have other app ideas for Twitter, Spotify, Yelp, SendGrid, etc., just register for our own keys and use those. They are all free for low-volume transactions.

OPTION 1: YELP

For option 1, 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. Your recommendation system will do the following:

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 in a variable called categories (a comma-separated list of categories).

  3. Proved the user with a way to either clear out or update their selected categories.

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.

3. Allow user to view restaurants that match the selection criteria

Given the user’s selected location, categories, and sorting criteria:

  1. Retrieve the restaurants, and allow the user to specify an additional keyword before executing the search (see demo).

  2. Print the retrieved restaurants to the screen in some coherent format (consider using a pandas dataframe for this).

4. Allow the user to preview an individual restaurant

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.

5. Allow the user to email a restaurant recommendation

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. Use the sendgrid.send_mail function to help you.

EXTRA CREDIT OPTIONS

[2 Points] Allow the user to select a location

You will give the user the option of selecting a location to search (which defaults to Evanston, IL). The user should be able to update this location whenever they want. Once it is set, this location will be used to filter their restaurants (Yelp requires a location).

[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” 

If you have time and need extra credit, you may enhance your program by also giving the user the option of specifying only restaurants which are currently open

[3 Points] Extra Credit: Generate an HTML file 

Generate an HTML file with the table of recommended restaurants as well as some information about each one. Consider embedding images of the restaurants into the file.

[5 Points] Extra Credit: Create a Map of Restaurants

Given the HTML file you’ve just generated, figure out how to create a map of all of the restaurant recommendations (using folium).

[5 Points] Incorporate another information source

In addition to searching Yelp, try integrate data from Twitter (or some other source) using some of the lecture samples from Week 9. You can earn up to 5 points for each provider that you incorporate.

[5 Points] Figure out how to attach the HTML file to an email

Take a look at this article:

  • https://stackoverflow.com/questions/40656019/python-sendgrid-send-email-with-pdf-attachment-file


What to Turn in

  1. Your code as a zip file. This should include all of the files that make your code work.

  2. An explanation of the features you implemented for the graders (and whether or not you attempted any extra credit. You can do this as a separate text file inside of your zip file or in the submission comments. DO NOT FORGET TO DO THIS — WE WANT TO GIVE YOU CREDIT FOR THE EFFORT YOU PUT INTO YOUR PROGRAM!

RUBRIC (40 Possible Points)

Feature

Possible Points

Scoring Guidelines

Main Program Loop

5 points

  • Loop handles errors (incorrect inputs)

  • Loop prompts the user for their input

  • Loop honors user requests

  • Loop does not exist unless user asks to quit

Category selection

5 points

  • Displays categories

  • Allows user to select among categories

  • Allows user to clear out selected categories and start over

Ordering/Sorting Criteria

3 points

  • Allows user to specify their preferred ordering criteria (best_match, rating, review_count, distance).

Previewing matching restaurants

8 points

  • Results honor user’s selected location, categories, and sorting criteria

  • Allows the user to specify a search keyword

  • Prints restaurants to the screen in some coherent format (consider using a pandas dataframe for this).

Previewing individual restaurant

10 points

  • Allows user to preview an individual restaurant

  • Includes detail about restaurant

  • Includes restaurant reviews

Sends email 

6 points

  • Successfully emails a restaurant recommendation to a user

Code Quality

3 points

  • All functions, variables, and file_names have pneumonic 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)

Extra credit

Up to 10 points

  • Students completed various EC options according to the specifications above.


OPTION 2: SPOTIFY

For option 2, you are going to use the Spotify API to create a music recommendation system. I have created a spotify module for you, located in the apis folder.  Your system will do the following:

1. Allow the user to select one or more genres of music

You will give the user the option of selecting one or more genres that can be used to “seed” the Spotify song recommendations system. To do this you will do the following:


Related Questions in computer science category