Skip to content

PyLadies-Athens/Spotify-Wrapped-PyLadies-Workshop

Repository files navigation

Spotify-Wrapped-PyLadies-Workshop

🎵 Workshop: Build Your Own Spotify Wrapped with Python

Welcome to the Code Your Own Wrapped workshop! In this session, we will transform raw JSON files into a beautiful, interactive data story using Python, Pandas, Matplotlib, Squarify & ipywidgets.

🚀 Getting Started

  1. Open Google Colab.

  2. Upload Notebook. If you have your own dataset, please upload the "Spotify Wrapped Workshop (Real Data)" and if you don't bring your own data the "Spotify Wrapped Workshop (Dummy Data)".

  3. Run the Installation and Reading of data cells (provided in the repository) to "read" your music history.

🛠️ Step-by-Step Guide

📍 Insight 1: The KPI Card (Total Minutes)

Goal: Create a high-impact visual "Card" showing the total minutes listened.

Logic: We use df['minutes'].sum() to get the total.

Visual: Instead of a chart, we use plt.text to draw a stylized card with the Spotify Green border.

📍 Insight 2: Top 10 Artists (Bar Chart)

Goal: Rank the top 10 artists by listening time.

Logic: We groupby the Artist Name, sum the minutes, and use nlargest(10) to find the winners.

Visual: A horizontal bar chart. We use Conditional Coloring: the #1 artist is Green, and the rest are Black.

📍 Insight 3: Monthly Trends (Line Chart)

Goal: See how your music habits changed throughout the year.

Logic: We extract the month from the timestamp and reindex them to ensure they appear in order (Jan, Feb, Mar...).

Visual: A line chart. We set the Y-axis to max + 200 so the labels have room to "breathe" at the top.

📍 Insight 4: Weekly Rhythm (Bar Chart)

Goal: Discover your "Power Day" of the week.

Logic: Similar to months, but we group by Day Name (Monday, Tuesday, etc.).

Visual: Vertical bars. The most active day is automatically highlighted in Green.

📍 Insight 5: The Night Owl Test

Goal: Calculate how much music you listen to during "vampire hours."

Logic: We filter the data where the hour is between 0 (midnight) and 4 AM.

Visual: Text summary displaying the total late-night minutes and your top "dark-hour" track.

📍 Insight 6: Top 10 Songs (The Anthems)

Goal: Identify the specific tracks you had on repeat.

Logic: Grouping by trackName instead of Artist.

Visual: A sorted horizontal bar chart with data labels showing the exact minutes for each song.

📍 Insight 7: The Big Binge

Goal: Find the single day where you listened to the most music.

Logic: We group the data by the specific date and find the max value.

Visual: A narrative reveal of your most legendary listening session.

📍 Insight 8: Genre Kingdom (Treemap) or Favorite Album (Bar Chart)

Goal: Visualize the diversity of your music genres or album names.

Logic: Using the genre (album names) column we created in the enrichment step.

Visual 1: A Treemap. Large rectangles represent dominant genres. We sort them descending so the biggest genre is always in the top-left.

Visual 2: A Bar Chart. Each bar represent album names. We sort them descending so the most listened album name.

📍 Insight 9: Hourly Intensity (Line Chart)

Goal: Map your energy levels throughout the 24-hour day.

Logic: Grouping by hour (0-23).

Visual: A line chart with square markers. The peak hour (e.g., 5 PM) is highlighted with a large Green marker.

📍 Insight 10: The Wrap-Up

Goal: Provide a final summary of your musical soul.

Logic: Combining the top artist and a count of unique days active.

Visual: A final "Thank You" message to conclude the presentation.

🎮 The Interactive Engine

At the bottom of the script, we use ipywidgets.Button.

The Output Area stays at the top.

The Next Button stays at the bottom. This creates a "Slideshow" experience where the user clicks to reveal the next discovery.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors