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). For this project you will: Install sendgrid (on the command line), which is an email library: Download the starter files. Modify the authentication.py file (inside of the apis folder) and add the course API key. To do this: Navigate to Canvas > Assignments > Project 2 Replace lines 8-16 of apis/authentication.py with the following line: Pick one of two themes: music (Spotify) or food (Yelp) Get oriented with the relevant helper modules apis.yelp, apis.spotify, apis.sendgrid that will help you interact with the data provider Fulfill the requirements of the assignment Earn up to 10 points extra credit by completing optional enhancements 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. 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: 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 in a variable called categories (a comma-separated list of categories). Proved the user with a way to either clear out or update their selected categories. 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. Given the user’s selected location, categories, and sorting criteria: Retrieve the restaurants, and allow the user to specify an additional keyword before executing the search (see demo). Print the retrieved restaurants to the screen in some coherent format (consider using a pandas dataframe for this). 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() 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. Use the sendgrid.send_mail function to help you. 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). 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. 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 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. Given the HTML file you’ve just generated, figure out how to create a map of all of the restaurant recommendations (using folium). 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. Take a look at this article: https://stackoverflow.com/questions/40656019/python-sendgrid-send-email-with-pdf-attachment-file Your code as a zip file. This should include all of the files that make your code work. 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! 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: 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:PROJECT OVERVIEW
pip install sendgrid
API_TUTOR_TOKEN = 'API_TOKEN_ON_CANVAS_ASSIGNMENT_PAGE'IMPORTANT BACKGROUND INFORMATION
OPTION 1: YELP
1. Allow the user to select among the Yelp restaurant categories
2. Allow the user to set the sorting criteria
3. Allow user to view restaurants that match the selection criteria
4. Allow the user to preview an individual restaurant
5. Allow the user to email a restaurant recommendation
EXTRA CREDIT OPTIONS
[2 Points] Allow the user to select a location
[3 Points] Allow the user to set the price filters
[2 Points] Allow the user to filter by restaurants that are “open now”
[3 Points] Extra Credit: Generate an HTML file
[5 Points] Extra Credit: Create a Map of Restaurants
[5 Points] Incorporate another information source
[5 Points] Figure out how to attach the HTML file to an email
What to Turn in
RUBRIC (40 Possible Points)
OPTION 2: SPOTIFY
1. Allow the user to select one or more genres of music
Get Free Quote!
352 Experts Online