spotify analysis

This was my second Python project. I was inspired by the Spotify wrapped, and since it only lets you see it once a year, I started coding. I wanted to see my top artists, top songs, and much more anytime I want and not just when it's the last month of the year. Once you have your Spotify data downloaded and you put them in, you're asked whether you want to use data from the past month or the whole year. You see the results immediately. Firstly, you see the number of tracks you've listened to but also how much time you've spent listening to them. All of your top artists and top songs are then saved to new files named 'Artists_Listen_Time.txt' and 'Songs_Listen_Time.txt' found in the same directory. But that's not all! You can also see other stats, such as at what time you listen to music the most. Meaning you get to know how many songs you've heard within each hour of the day.

Go Up

how it works

  1. The JSON files are loaded by a user
  2. The user is asked to enter whether to count data from the last month or the whole year
  3. Looping through the songs, it finds the date of the first and last listen ever and counts off a month backwards
  4. It looks at the time of the listen and counts the number of listens within each hour
  5. Next, it extracts the listen time of each song and calculates the total listen time
  6. It counts the number of minutes each artist has been listened to
  7. A new file is created, where the top artists are stored in descending order
  8. The same goes for counting the 'top songs'
  9. Full results are again being saved to a new file
  10. A conclusion including some interesting stats is shown in the command line

Contact

Leave a message:

Prague, Czech Republic

Copyright © 2021 Adam Tran