Code Monkey home page Code Monkey logo

forked-spotifystattracker's Introduction

What Is SpotifyStatTracker?

SpotifyStatTracker is a Python program that analyzes and tracks a user's Spotify listening habits and statistics. At the end of every week, an email is sent to the user detailing various statistics about their listening habits. Tracked statistics include stats like a user's most played song, how many minutes of music they listened to, and their current favorite artist.

How Does It Work?

This program utilises the Spotify API and the Spotipy library in order to collect data about the user's Spotify listening history. In order for this data to be collected regularly so accurate weekly statistics can be calculated, this program runs every 10 minutes on a PythonAnywhere cloud. User data from the Spotify API is fetched by the program every time it run. The program then compares the new data to the current data and appends the new data points not yet stored. This data is stored in a local json file for easy access.

At the end of every week, the program will parse the data from the json file and calculate various statistics from it. More specifically, these stats would be:

  • Most Played Song
  • Most Played Artist
  • Most Played Album
  • Number of Songs Played
  • Number of Minutes Listened

In addition to generating stats about a user's listening habits, the program will generate a custom playlist of each unique song played by the use that week. This playlist will then be added directly to the user's Spotify profile. Using the smtplib library, a custom email with the listenings stats and a link to the playlist are sent to the user's email. Once this is all complete, the program wipes the previous week's data and starts tracking anew.

NOTE

In order for this program to work, a config.py needs to be implemented by the current user. All constants from config.py, such as TO_EMAIL and FROM_EMAIL, must be filled in by that user. As well, the user must connect themselves to the Spotify API.

forked-spotifystattracker's People

Contributors

justindiep17 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.