An interactive data visualization platform designed to analyze personal Spotify streaming history. The application compares musical tastes between users (Ola & Maciek), tracks global artist origins, and provides deep insights into listening habits through an intuitive, dark-themed dashboard.
This project started as a tool to explore long-term music trends and discover overlaps in music tastes. It processes extended Spotify streaming history (JSON files) into optimized data formats for real-time analysis. The entire frontend is built with Streamlit, featuring custom CSS to mimic a premium dark-mode experience.
You can find the application running at: https://spotify--stats.streamlit.app
The core of the application is divided into four specialized modules accessible via the sidebar navigation:
- Home: A comprehensive overview of listening habits. Features a "Music Activity Calendar" (GitHub-style heatmap), top artist rankings with direct Spotify links, and a Lyric Word Cloud powered by the Genius API to analyze the most frequent vocabulary in favorite songs.
- Shared Analysis: A comparison engine that identifies common ground between users. It highlights "shared" artists, tracks, and albums, using a 7-day rolling average trend line to show how mutual interests evolved over time.
- Artists on the Map: A geospatial exploration of music. It uses Mapbox to pinpoint where artists come from, allowing users to filter by continent and country to see local popularity trends and regional top charts.
- Wrapped Experience: A gamified "Wrapped" summary where users can test their knowledge by guessing their top artists/songs before the results are revealed through interactive UI elements.
- Data Pipeline: Custom scripts to convert raw Spotify JSON exports into
PandasDataFrames, stored asPicklefiles for high-speed loading. - API Integration: Real-time fetching of artist metadata and imagery via
Spotipyand automated lyric scraping viaLyricsGenius. - Dynamic Visualization: Complex interactive charts built with
PlotlyandPyplot, including custom-styled bar charts, maps, and activity calendars. - NLP & Language Detection: Uses
langdetectto categorize top songs by language before generating linguistic word clouds.
| Layer | Technology |
|---|---|
| Frontend | Streamlit, Custom CSS |
| Data Processing | Pandas, NumPy, Pickle, Glob |
| External APIs | Spotify Web API (Spotipy), Genius API |
| Visualizations | Plotly (Maps & Charts), Matplotlib (Word Clouds) |
| Geodata | Mapbox |
- Clone the repository and install dependencies:
pip install -r requirements.txt - Configure your credentials in
.streamlit/secrets.toml:MAPBOX_TOKENSPOTIPY_CLIENT_ID/SPOTIPY_CLIENT_SECRETGENIUS_ACCESS_TOKEN
- Run the application:
streamlit run main.py