Git Product home page Git Product logo

calculate-chart-success-2's Introduction

chart_success.py

A script to calculate the chart success of an artist, writer or producer on a billboard chart over the years.

The simple metric calculated is as follows: A no. 1 song is valued as 100, a no. 2 song is valued as 99, etc., a no. 100 song is valued as 1. All song values of each chart of each year are added together.

This is a improved version of calculate-chart-success with better accuracy. Here not only song titles are compared, but also the artist names. Therefore two lists are necessary instead of only one in the previous version.

A very similar approach has been used in the FiveThirtyEight Article: 25 Years Of Super Bowl Halftime Show Lineups, Ranked. The article appeared one year after i published this repository.

Usage to evaluate a writer or producer

  1. Go to the discography of the person you want to evaluate on Wikipedia. Select the whole table with the songs (Ctrl+C). Copy the table to libre office (Ctrl+V). Make shure each song has its corresponding cell with the name of the artist. Split the artist cells horizontaly if necessary. Select the column with the song titles in libre office. Copy them in libre and paste them into an an editor. Remove empty lines (Regex to find the lines: ^\n) and ". The result should be a list like the example 'Max_Martin_Songs_10-12-17' here. Do the same with the artist collum the result could look like 'Max_Martin_Artists_10-12-17'. Make shure every song is unique in the lists, duplicates are not removed.
    Hint: Use a shortcut in libre office to split the artist cells: Libre Office -> Tools -> Customize -> Keyboard-Tab -> Select Key Combinaton (e.g. F4) -> Select Table, Split Cells -> Click Modify -> Ok

  2. Create a database of charts with the function 'create_chart_database(chart_name, min_year, database_filename)'. See the docstring of the function in chart_success.py for more information.

  3. Use the function 'calculate_success(database_filename, songlist_filename, artistlist_filename)' to calculate the metric for each year. See the docstring of the function in chart_success.py for more information.

  4. Plot the results with the function plot_data(max_value, min_year, max_year, title, data). See the docstring of the function in chart_success.py for more information.

Usage to evaluate an artist

  1. Create a database of charts with the function 'create_chart_database(chart_name, min_year, database_filename)'. See the docstring of the function in chart_success.py for more information.

  2. Use the function 'calculate_artist_success(database_filename, artist)' to calculate the metric for each year. See the docstring of the function in chart_success.py for more information.

  3. Plot the results with the function plot_data(max_value, min_year, max_year, title, data). See the docstring of the function in chart_success.py for more information.

Dependencies

This script uses billboard.py by guoguo12 and fuzzywuzzy.

Example

All the songs Max Martin contributed to (according to his Wikipedia discography from 10.12.17) are listed in 'Max_Martin_Songs_10-12-17' and the corresponding artists in 'Max_Martin_Artists_10-12-17'. The result is shown below.

The added values for this example can be seen in 'Max_Martin_Output_10-12-17'. The output seems accurate. Of course errors are possible for example because song titles and artist names are similar and/or the lists imperfect.

Here are some more examples:

calculate-chart-success-2's People

Contributors

3ngthrust avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

calculate-chart-success-2's Issues

Question

Hello!

Is it possible to fetch with this not a person, but album chart history?

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.