Spotify Grid

Create a Grid of Your Top Albums From Spotify With Python.

Published: Dec 17, 2022 • Updated: Oct 6, 2024

0:00 / 0:00

Intro

I have always been interested in my music preferences and the raw data that is my streaming history. I recently built a custom Lifetime Spotify Wrapped and wanted to work on a visual project next. Spotify Grid.

In this article, I will walk you through how to create a grid of your top‑streamed album covers and artists from Spotify. The larger the image, the more times you have streamed that album or artist. The album in the center is my most streamed. Starting from the top left corner of each ring and going clockwise, the albums and artists decrease in total streams.

To create your own Spotify Grid, you will need exports produced in Lifetime Spotify Wrapped. The heavy lifting happens there; here we assemble a grid using the Pillow library in Python. If you prefer to jump to the code, the script is on GitHub.

2024 Spotify Album Mini Grid
2024

Download Images

Once you have the necessary Excel files from your Lifetime Spotify Wrapped, import them into this Python script. Create two folders named Artist-Images and Album-Images alongside the script.

Because you already have URLs for artist and album images, use requests to download and save each image. The helper function below takes a path and a grid type, builds a list of the top 49 items, and saves each image locally.

Create the Grids

I made two layouts: full_grid (49 images) and mini_grid (13 images). Both follow the same logic; only the sizes differ.

Full Grid, 49 images
Mini Grid, 13 images

The full grid uses an 8000×8000 background. The center image is the most‑streamed (for example 3200×3200), then two rings of 12 and 36 images (for example 1600×1600 and 800×800). Coordinates are calculated so that images align on horizontal and vertical segments; remember that Pillow pastes from the top‑left corner of a given coordinate.

Final Thoughts

After completing my Lifetime Spotify Wrapped project, I wanted to display the results in a single visual. These grids are a great way for any music enthusiast to show off their listening history.

2023 Spotify Album Grid
2023