CPSC 547 Project
The project consists of two main directories:
-
pipeline
: This directory contains all the code for processing the user's streaming history. Everything is written in python, using the pandas and numpy libraries to simplify and speed up the code. The spotipy library is used for authentication against Spotify and some of the data retrieval. All of the code in this directory is written by us, except code marked with comments explicitly stating otherwise*. -
d3_env/src
: This directory contains the code for the visualization part of Explorify. The code is a mix of Javascript and Typescript using React for rendering many of the components. D3 is used for creating the visualizations. React-Bootstrap is used for styling the HTML components. With the exception of the Calendar Heatmap, which is a modification of this heatmap calendar solution: https://bl.ocks.org/alansmithy/6fd2625d3ba2b6c9ad48, all of the code in this directory has been written by us (except code marked with comments explicitly stating otherwise*).d3_env
itself contains additional files for the purpose of running Explorify. These can be disregarded, and/or assumed to not be our work.
Some other files and directories of note:
- The directories
data
andd3_env\src\data
contain the results of running the pipeline. - In addition there are a couple of notebook files at the top level. These were used to prototype and develop the code which became the final pipeline.
* There are very few such comments throughout the project.
Requirements: Python >= 3.8
- Retrieve your personal spotify listening history by visiting your Spotify account privacy page and following the instructions at the bottom of the page.
- Upon receiving your data, extract the file called "StreamingHistory0.json" into the data folder in this directory.
- Set one of the two following sets of environmental variables:
SPOTIFY_API_TOKEN
. You can generate this by going to the console at developer.spotify.com and copying the generated OAuth token.SPOTIFY_CLIENT_ID
andSPOTIFY_CLIENT_SECRET
. You get these by creating a new app in your dashboard at developer.spotify.com.
pip install -r requirements.txt
- Run the pipeline by running
main.py
from inside the pipeline directory.
Requirements: npm >= 6
, a modern web-browser
- In the d3_env folder, run
npm install && npm start
- In your browser, navigate to:
localhost:1234
help