| đš Audio Docs | đ GUI Docs | đ§ Twilio Docs |
For option 2, you are going to use the Audio API to create a mixtape-maker. I have created an audio module for you, located in the apis folder that will give you access to a lot of real data from both Spotify and Last.FM. All of the apis/audio.py functions have been documented here.
Your goal is to generate a mixtape to send to your friends. To do this, youâre going to write a program that allows people to select some different entries for your mixtape: mainly genre(s) and artist(s), but also possibly track(s) and albums(s). 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! For instance, the video doesnât make use of the gui.numeric_input() function which prevents users from typing in a non-numeric input. It also doesnât have separate buttons for the âclearâ functionality (checkout the video for the movies project!).
Please implement the following required features of your mixtape maker (we encourage you to start with the mixtape_maker.py template):
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 as a starting point for your mixtape. To do this you will do the following:
- Present the user with a list of available genres using the
audio.get_genresfunction. - Ask the user to select one or more genres and store them in the
user_selectionsdictionary. - The user should be able to clear out or delete these selections (this can be placed in a separate button - see the Movie project example video!).
- We should see these selections displayed on the main menu (like in the demo vid)
These actions must happen when the user clicks on the Select Genres button in the GUI.
2. Allow the user to select one or more artists
You will also give the user the option of selecting one or more artists that can also be used to add to your mixtape. To do this you will do the following:
- Provide a way for the user to search for and display artists (use the
audio.search_for_artistsfunction) - Provide a way for the user to select the artists theyâre interested in and store them in the
user_selectionsdictionary (hint: store their ids tooâŚ) - Allow the user to either clear out / delete or append artists their selections (this can be placed in a separate button - see the Movie project example video!).
- We should see these selections displayed on the main menu (like in the demo vid)
These actions must happen when the user clicks on the Select Artists button in the GUI.
3. Generate and email the mixtape
Given the userâs selected genres and artists:
- Generate a mixtape using the
audio.generate_mixtapefunction. - Print the retrieved tracks to the GUI Window using
audio.generate_tracks_table. - Ask the user if they want to email the mixtape to someone, and if so, send an email (use the
twilio.send_emailfunction to help you) with the tracks. Your email needs to be readable â you can either design a custom email or use theto_HTMLoption of thegenerate_tracks_tablefunction.
NOTE: The
audio.generate_mixtapefunctionâs job is to get tracks based on the data you give it. It has very specific requirements about what inputs it needs to work.
NOTE 2:
audio.generate_mixtape has a special argument calledpractice that defaults toTrue which means it gives you back âpractice dataâ so as to not make Spotify / Last.FM think weâre bots generating random non-working requests. Once you have gotten everything working, you can start getting real mixtape tracks by changing this input toFalse. Do this AFTER your program is 100% working (including the emailing part). When in practice mode, this function always give you back the same Fake Mixtape and will print WARNINGs instead of errors if you give it invalid inputs so make sure to pay close attention to the Interpreter Window. You will receive a 2 point deduction if you submit a project with thepractice parameter set toTrue since this indicates your program was never actually tested outside of practice mode.
These actions must happen when the user clicks on the Generate Mixtape button in the GUI.
Extra Credit Options (Up to 5 Points)
[3 Points] Allow the user to select one or more tracks by name
Give the user the option of selecting one or more tracks to add to your mixtape. To do this, you will do the following:
- Provide a way for the user to search for and display tracks
- Provide a way for the user to select the tracks theyâre interested in, store them in the
user_selectionsdictionary, and display on the main menu - Allow the user to either clear out or append to their tracks list
- Use those tracks as input to
audio.generate_mixtape
[2 Points] Search for albums by keyword
Allow the user to find albums based on a keyword search and show their contents in a readable manner.
[2 Points] Search for playlists by keyword
Allow the user to find playlists based on a keyword search and show their contents in a readable manner or a link to them.
[2 Points] Display newly released albums
Allow the user to find newly released albums show the album and artist names in a readable manner.
[2 Points] Display albums of artist selected
Allow the user to pick one of their previously selected artists and display all of their albums in a readable manner.
Rubric (40 Possible Points)
| Feature | Points | Scoring Guidelines |
|---|---|---|
| Main Program | 5 points |
|
| Genre Selection | 8 points |
|
| Artist Selection | 12 points |
|
| Generate and email the mixtape | 11 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.