This is a method of identifying tracks that are "spiking" on a given label's catalog on a given day. How we identify a “spike”: On a given day (most recent day of available Spotify data): 1. Look at a label’s top 10% of tracks in terms of Spotify streaming 2. From that group, drop any tracks with <200 Spotify streams 3. For the remaining tracks, get the: - Average daily Spotify streams over the past 90 days - Standard deviation of Spotify streams over the past 90 days - Spotify streams on most recent day 4. Use the above data to calculate a Z-score: Z = (streams_today - average_streams) / (standard_deviation_streams) 5. Any track with Z > 4.5 is “spiking” historical.sql gets: - TRACKID - TRACKNAME - ARTISTNAME - PERCENT_RANK - AVG - STD lw.sql is used to generate trend lines for the past week for spiking tracks (to visualize the spike) - TRACKNAME - ARTISTNAME - DAY (gets last 7 days) - TRACKID - PERCENT_RANK - SUMS (Spotify streams) placements.sql is used to get any recent playlist placements for spiking tracks - TRACK - ARTIST - pl.NAME - LINK - DATE_ADDED - STREAMS (from playlist) today.sql gets the most recent day's data: - TRACKNAME - TRACKID - ARTISTNAME - PERCNT_RANK - ISRCID - TODAY (streams on most recent day) Finally, spike_detector_script.py takes all the data gathered from the above queries, puts it into Pandas dataframes, and does the necessary calculations to get Z-score, print spiking tracks, print placements, and print trend graphs.