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!
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_genres
function. - Ask the user to select one or more genres and store them in the
user_selections
dictionary. - The user should be able to clear out or delete these selections.
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_artists
function) - Provide a way for the user to select the artists they’re interested in and store them in the
user_selections
dictionary (hint: store their ids too…) - Allow the user to either clear out / delete or append artists their selections.
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_mixtape
function. - 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_email
function to help you) with the tracks. Your email needs to be readable – you can either design a custom email or use theto_HTML
option of thegenerate_tracks_table
function.
NOTE: The
audio.generate_mixtape
function’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 not do this** until your program is 100% working (including the emailing part). When in practice mode, this function will print WARNINGs instead of errors if you give it invalid inputs so make sure to pay close attention to the Interpreter Window.
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_selections
dictionary, 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.