It's not that I'm so smart, it's just that I stay with problems longer. - A. Einstein
We bet this one's going to be music to your ears (another quality pun!).
This week, query the Spotify API and write some code that performs the set of tasks we've listed below.
If you have another music service you'd rather use, feel free!
Now for the challenge tasks:
Query Spotify and grab a list of album names for any given artist. Bonus points if the script allows the user to specify the artist!
Create a playlist on your account if you don't already have one. Write a script that queries Spotify for the playlist and returns all tracks/songs in the playlist.
This one's tricky: write a script that obtains a list of the top tracks for an artist and see if any of those songs exist in your playlist.
Feel free to dig into the API and go wild!
If you don't have an existing playlist, just create one with random artists and use it as your data set.
Hint: Check out the Spotipy Python Library to make this a little easier on yourself.
If you need help getting ready with Github, see our new instruction video.
A few more things before we take off:
Do you want to discuss this challenge and share your Pythonic journey with other passionate Pythonistas? Confirm your email on our platform then request access to our Slack via settings.
>>> from pybites import Bob, Julian Keep Calm and Code in Python!
Do you want to get 250+ concise and applicable Python tips in an ebook that will cost you less than 10 bucks (future updates included), check it out here.
"The discussions are succinct yet thorough enough to give you a solid grasp of the particular problem. I just wish I would have had this book when I started learning Python." - Daniel H
"Bob and Julian are the masters at aggregating these small snippets of code that can really make certain aspects of coding easier." - Jesse B
"This is now my favourite first Python go-to reference." - Anthony L
"Do you ever go on one of those cooking websites for a recipe and have to scroll for what feels like an eternity to get to the ingredients and the 4 steps the recipe actually takes? This is the opposite of that." - Sergio S