Inspiration

The inspiration behind this project came from my personal experience of frequently listening to the same set of songs on repeat until I eventually get tired of them. I realized that I rarely explore new music outside of my comfort zone, except when someone else takes control of the playlist. To address this, I decided to create a tool that would generate playlists on Spotify based on different moods or factors that I consider at the time.

What It Does

The project is a playlist generator. It takes a prompt as input and uses the OpenAI API to retrieve a playlist of songs that match the given prompt. The process is straightforward: you provide a prompt through the terminal, such as "5 songs to listen to while feeling sad and heartbroken," and the tool generates a curated playlist for you.

How I Built It

To build the project, I utilized the OpenAI API, which allows me to provide a prompt and receive an output based on that prompt. I used various modules in the implementation, including openai for API interactions, dotenv to securely store my Spotify developer credentials, json for parsing JSON data, argparse for handling command-line arguments, and spotipy to access the Spotify music data.

Challenges I Faced

Throughout the project, I encountered a few challenges. As it was my first time working with APIs and AI tools, there was a learning curve involved. Initially, I struggled with authenticating my credentials with Spotify due to some bugs in my code. This made me nervous about making API requests since each request incurred a cost. I eventually resolved the issue after a good night's sleep and debugging session. Another challenge I faced was obtaining valid JSON data. Despite searching extensively for documentation, I kept encountering errors. I realized that I needed to provide a more precise prompt to receive the results that were needed to process the data.

Accomplishments That I'm Proud Of

I am extremely proud of this project and what I have achieved. Building this tool allowed me to gain experience working with APIs, read and understand documentation thoroughly, and learn about AI tools. Although I initially planned to work with teammates, I found it rewarding and enjoyable to work on the project independently.

What I learned

Thanks to the project, I learned valuable lessons in patience, thoroughness, and seeking help when needed. I discovered the importance of carefully reading and understanding documentation, as it can provide crucial insights and solutions to problems.

What's Next For Mood Playlist

Moving forward, I want to develop a web application that users can use to input prompts and generate playlists directly through a user-friendly interface. This would make the playlist generation process more accessible and convenient for users, allowing them to explore new music based on their moods and preferences. So far, I built a Flask app with a semi-nice frontend but I still need to work on connecting it with the Spotify API.

Built With

Share this project:

Updates