By: [email protected]

Published December 19, 2024 at 11:42 PM

How I Built My Own Spotify Wrapped (But for Life)

Discover how I turned my obsession with notes and data into a personal 'Spotify Wrapped' for life. This post dives into my end-of-year ritual of analyzing my year with custom code, a bit of AI, and a touch of humor!

How I Built My Own Spotify Wrapped (But for Life)

Introduction

If you know me-or have read any of my blog posts-you probably know two things about me: I take a lot of notes, and I’m fascinated by statistics and trends.

From Apple Health to Spotify Wrapped, I love tools that analyze data to tell a story. A story that usually doesn't matter, but I digress.

That said, don’t ask me to share my Spotify Wrapped. Ever.

Given how much I track my day-to-day life-TODO lists, journal entries, random thoughts-it hit me a few years ago: why not build my own version of Spotify Wrapped for my life?

Something to reflect on the year I’ve lived and the habits I’ve built.

Daniel's "Wrapped" Process

As you might guess, I did what any self-respecting software engineer would do: I spent far too much time coding a custom program to analyze my notes, summarize my year, and highlight patterns.

It started as a curious experiment but has since evolved into an essential end-of-year ritual.

How It Works

Without getting too deep into the code (it’s very personal), here’s the general workflow:

  1. Scan My Notes: The program processes a year’s worth of journal entries, TODO lists, and other notes.
  2. Identify Insights: - Milestones and Wins: Big projects, achievements, and personal breakthroughs. - Habits and Trends: Recurring thoughts or behaviors-like, "What topics did I focus on most?" or "What made me happiest?" - Growth Opportunities: Areas I could improve or re-prioritize.
  3. Generate a Yearly Report: A concise, insightful summary of how I spent my year.

Why This Ritual Matters to Me

This isn’t just about stats-it’s about storytelling. Revisiting forgotten moments or rediscovering long-buried insights from February in December feels magical.

It’s easy to get caught up in the grind of daily life, but this exercise gives me a clearer view of where I’ve been and where I want to go.

I also think this is a great way to take my bias out of the picture. What did my year actually look like? How did I compare to last year?

Is There a Product Here?

Over the years, friends have asked me if they could use this too-but, sadly, notes are deeply personal and custom.

That said, people love Spotify Wrapped the last few years. The idea of a “life analytics” tool definitely has some weight, but it’s not without challenges, namely:

  • Everyone’s Notes Are Different: Formats vary, and not everyone even takes notes.
  • Insights Are Personal: What’s valuable to me might not resonate with others.

Still, with AI’s rapid advancements, I can’t help but wonder: could a tool like this help people see their lives more clearly?

The AI File Analyzer: A Generalized Version

Inspired by my personal program, I’ve created and open-sourced AI File Analyzer.

This project uses AI and open-source large language models (LLMs) to parse and analyze files. While my personal analyzer is entirely custom and doesn’t use AI, this generalized version serves as a proof of concept for what’s possible.

Current Features and Limitations

To be clear off the bat-it’s far from perfect.

This analyzer is a basic implementation, but it proves the core idea:

  • Strengths: It can process text-based files and extract interesting patterns or summaries.
  • Weaknesses: It’s slow, lacks polish, and could use some more functionality.

Behind the Scenes With the Code

The code is pretty straightforward, but I thought it could be nice to walk through it.

At its core, this project is designed to process directories, analyze file contents, and summarize key insights using AI. Here's a high-level breakdown of its main components:

  1. File Type Identification: The function get_file_type determines a file's type based on its extension and MIME type. This allows the program to filter and handle files differently based on their format.

  2. Content Analysis: Files with text-based content are passed to the analyze_file_content function, which uses a summarization model from the Hugging Face transformers library. For performance, it processes a truncated sample of the file content, generating concise summaries.

  3. Directory Scanning: The process_directory_contents function walks through a specified directory (while skipping system folders like .git or node_modules) and collects statistics:

  • File types and their counts.
  • Total size of the files.
  • Monthly activity based on modification timestamps.
  • Summaries of eligible text files.
  1. Generating Reports: The program provides two types of reports:
  • Year Wrapped Report: Inspired by Spotify Wrapped, this gives a concise overview of your year's activity, including the busiest months, top file types, and highlights from text files.
  • Detailed Report: A comprehensive analysis that includes file type distributions, summaries, and statistics about the directory's contents.
  1. Summarization Model: The project utilizes the facebook/bart-large-cnn summarization model from Hugging Face. While my personal implementation doesn't use AI, this model allows the generalized version to analyze diverse files and generate meaningful summaries.

  2. Performance Considerations: To prevent overloading, the code limits the number of files processed (MAX_FILES_TO_PROCESS) and skips files above a certain size or with unsupported extensions. It’s not optimized for large datasets, so patience is key for bigger directories.

  • Potential improvements 👀

Ideas for Improvement

Here are some ways this project could be expanded:

  • Speed: It’s not optimized for performance and can be slow with larger and larger datasets.
  • Sentiment Analysis: I tried doing some sentiment analysis but it was not very good. I think this could really add more info to the output.
  • Customization: One thing I'd love to add to this is allow for more customization of the output.
    • For example - maybe allow the user to prompt what information they want to see in the output? Could be that easy.
  • AI Model: I'm using open source HuggingFace models, but I'm sure there are better ones out there.
  • File Types: I'm only using text files, but this could be extended to other file types.
  • Data Sources: I'm only using my own notes, but this could be extended to other data sources.
    • Email / web seemed like the most interesting ones to me.
  • Visualization: I'm not doing any visualization, this is purely text based, but this could be extended to create a UI like Spotify Wrapped.

If you’re curious, feel free to make a PR or fork the repo and try it out. I’d love to hear your ideas for taking it to the next level!

Conclusion

As silly as it sounds, this experiment has become one of my favorite traditions.

It’s not just a productivity hack-it’s a way to celebrate, reflect, and grow. By stepping back to analyze my year, I find clarity about what worked, what didn’t, and what’s next.

Whether or not this idea evolves into a full-fledged product, I hope it sparks inspiration. Taking time to reflect on your year-whether through notes, photos, or something else entirely-can be incredibly rewarding.

Hopefully, you try out this experiment yourself, or at the very least, give your year the proper reflection it deserves.

Happy New Year, Everyone! 🎉

Resources

Comments

No comments available :/

Leave your thoughts! 💭


Tags

ML/AI

Python

Spotify

Say hi!