Create a class – Hire Academic Expert

import requests url = ‘https://itunes.apple.com/us/rss/topsongs/limit=100/json’ response = requests.get(url) data = response.json() for artist_dict in data[‘feed’][‘entry’]: artist_name = artist_dict[‘im:artist’][‘label’] album_name = artist_dict[‘im:collection’][‘im:name’][‘label’] song_name = artist_dict[‘title’][‘label’] print(artist_name) print(album_name) iTunes API part 1 1. use the attached itune.py file to connect to itunes api. Test to make sure it runs on your computer. This display the current top 100 songs on iTunes. 2. Create a class which store the artist name, album name, and song name. Make sure to create __str__ and also any associated get and set methods for the three variables above. 3. Store each song’s artist name, album name and song name from step 1 into the class created in step 2. 4. Create a list and append all 100 songs from step 3 into the list and call the list topsongs[] 5. Write a function and search for an artist name (input is the artist name), say, Taylor Swift against topsongs[], and display all the artist name, Album name and Song name. Example of the output. Artist Name: Taylor Swift, Album Name: Lover, Song Name: Lover ….. From the result in step 5 above, there may be songs from the same album that made it to the top 100 song chart. (Say, Taylor Swift has two or three top 100 songs from the same album). There may also be multiple songs from Taylor Swift from multiple album that made it to the top 100 song chart. Adjust your code from Part 1, which accommodate the multiple songs from the same album, and multiple songs from multiple albums. Hint: You will need to create another class for Album and have it used in the part 1 of the code. YOUR CODE FOR PART 2 has to be based on PART 1. Write a function and search for an artist name (input is the artist name), say, Taylor Swift against topsongs[], and display all the artist name, Album name and Song name. Example of the output. Artist Name: Taylor Swift, Album Name: Lover, ….. Album Name: Christmas Tree Farm – EP, Song Name: Christmas Tree Farm

Comments are closed.