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:

  1. Present the user with a list of available genres using the audio.get_genres function.
  2. Ask the user to select one or more genres and store them in the user_selections dictionary.
  3. 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:

  1. Provide a way for the user to search for and display artists (use the audio.search_for_artists function)
  2. 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…)
  3. 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:

  1. Generate a mixtape using the audio.generate_mixtape function.
  2. Print the retrieved tracks to the GUI Window using audio.generate_tracks_table.
  3. 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 the to_HTML option of the generate_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 called practice that defaults to True 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 to False. **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:

  1. Provide a way for the user to search for and display tracks
  2. 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
  3. Allow the user to either clear out or append to their tracks list
  4. 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
  • Handles errors (incorrect inputs) (Note: this applies anywhere you ask the user for input)
  • App prompts the user for their input
  • App honors user requests
  • App does not exit unless user asks to quit
Genre Selection 8 points
  • Displays the user's selected genre(s) if any on the Main Menu
  • Displays available genres via the GUI (either popup or textbox)
  • Allows user to select among the genres that are presented (and no others)
  • Allows user to clear out their selected genres and start over
Artist Selection 12 points
  • Allows user to search for artist
  • Allows user to select among artists returned from Spotify
  • Allows user to clear out selected artists and start over
  • Displays the names of the user's selected artists' names via the GUI textbox
Generate and email the mixtape 11 points
  • Correctly passes arguments of correct type into the generate_mixtape function
  • Displays mixtape to the GUI textbox (including track name and artist name)
  • Successfully emails the mixtape list 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