Moodify is a web application that uses the Spotify API to generate playlists based on a users Spotify listening history and current mood.
Table of Contents
Once authorized, Moodify gathers and stores a users listening history in a PostgreSQL database along with information for three audio features: danceability, energy, and valence. In order to uniformly segment the data provided by Spotify, Moodify normalizes the audio feature data for each user and an algorithm is applied to the normalized values to create a playlist with tracks specific to the user and their current mood. Once the playlist is created, the users can then view and play their playlist through Spotify as well as Moodify itself.
Backend: Python, Flask, SQLAlchemy, PostgreSQL
Libraries: Scipy, Numpy
Get Client ID and Client Secret from Spotify and save them to a file
export SPOTIFY_CLIENT_SECRET=YOUR_KEY export SPOTIFY_CLIENT_ID=YOUR_KEY
On local machine, go to directory where you want to work and clone Moodify repository:
$ git clone https://github.com/mahnoorshafi/Moodify.git
Create a virtual environment in the directory:
$ virtualenv env
Activate virtual environment:
$ source env/bin/activate
$ pip install -r requirements.txt
$ createdb moodify
Create your database tables:
$ python3 model.py
$ source secrets.sh
Run the app:
$ python3 server.py
Open localhost:5000 on browser.
- Fine tune algorithm that selects songs
- Give user's the ability to view all their past mood playlists
- Option to preview playlist and then save it