Code Monkey home page Code Monkey logo

taylor's Introduction

taylor

Project Status: Active – The project has reached a stable, usable state and is being actively developed. lifecycle R package version Package downloads
R-CMD-check codecov Netlify Status
Signed by License

Overview

The goal of taylor is to provide easy access to a curated data set of Taylor Swift songs, including lyrics and audio characteristics. Data comes Genius and the Spotify API.

Installation

You can install the released version of taylor from CRAN with:

install.packages("taylor")

To install the development version from GitHub use:

# install.packages("remotes")
remotes::install_github("wjakethompson/taylor")

Example

There are three main data sets. The first is taylor_album_songs, which includes lyrics and audio features from the Spotify API for all songs on Taylor’s official studio albums. Notably this excludes singles released separately from an album (e.g., Only the Young, Christmas Tree Farm, etc.), and non-Taylor-owned albums that have a Taylor-owned alternative (e.g., Fearless is excluded in favor of Fearless (Taylor’s Version)). We support artists owning their work.

taylor_album_songs
#> # A tibble: 240 × 29
#>    album_name   ep    album_release track_number track_name     artist featuring
#>    <chr>        <lgl> <date>               <int> <chr>          <chr>  <chr>    
#>  1 Taylor Swift FALSE 2006-10-24               1 Tim McGraw     Taylo… <NA>     
#>  2 Taylor Swift FALSE 2006-10-24               2 Picture To Bu… Taylo… <NA>     
#>  3 Taylor Swift FALSE 2006-10-24               3 Teardrops On … Taylo… <NA>     
#>  4 Taylor Swift FALSE 2006-10-24               4 A Place In Th… Taylo… <NA>     
#>  5 Taylor Swift FALSE 2006-10-24               5 Cold As You    Taylo… <NA>     
#>  6 Taylor Swift FALSE 2006-10-24               6 The Outside    Taylo… <NA>     
#>  7 Taylor Swift FALSE 2006-10-24               7 Tied Together… Taylo… <NA>     
#>  8 Taylor Swift FALSE 2006-10-24               8 Stay Beautiful Taylo… <NA>     
#>  9 Taylor Swift FALSE 2006-10-24               9 Should've Sai… Taylo… <NA>     
#> 10 Taylor Swift FALSE 2006-10-24              10 Mary's Song (… Taylo… <NA>     
#> # ℹ 230 more rows
#> # ℹ 22 more variables: bonus_track <lgl>, promotional_release <date>,
#> #   single_release <date>, track_release <date>, danceability <dbl>,
#> #   energy <dbl>, key <int>, loudness <dbl>, mode <int>, speechiness <dbl>,
#> #   acousticness <dbl>, instrumentalness <dbl>, liveness <dbl>, valence <dbl>,
#> #   tempo <dbl>, time_signature <int>, duration_ms <int>, explicit <lgl>,
#> #   key_name <chr>, mode_name <chr>, key_mode <chr>, lyrics <list>

You can access Taylor’s entire discography with taylor_all_songs. This includes all of the songs in taylor_album_songs plus EPs, individual singles, and the original versions of albums that have been re-released as Taylor’s Version.

taylor_all_songs
#> # A tibble: 356 × 29
#>    album_name   ep    album_release track_number track_name     artist featuring
#>    <chr>        <lgl> <date>               <int> <chr>          <chr>  <chr>    
#>  1 Taylor Swift FALSE 2006-10-24               1 Tim McGraw     Taylo… <NA>     
#>  2 Taylor Swift FALSE 2006-10-24               2 Picture To Bu… Taylo… <NA>     
#>  3 Taylor Swift FALSE 2006-10-24               3 Teardrops On … Taylo… <NA>     
#>  4 Taylor Swift FALSE 2006-10-24               4 A Place In Th… Taylo… <NA>     
#>  5 Taylor Swift FALSE 2006-10-24               5 Cold As You    Taylo… <NA>     
#>  6 Taylor Swift FALSE 2006-10-24               6 The Outside    Taylo… <NA>     
#>  7 Taylor Swift FALSE 2006-10-24               7 Tied Together… Taylo… <NA>     
#>  8 Taylor Swift FALSE 2006-10-24               8 Stay Beautiful Taylo… <NA>     
#>  9 Taylor Swift FALSE 2006-10-24               9 Should've Sai… Taylo… <NA>     
#> 10 Taylor Swift FALSE 2006-10-24              10 Mary's Song (… Taylo… <NA>     
#> # ℹ 346 more rows
#> # ℹ 22 more variables: bonus_track <lgl>, promotional_release <date>,
#> #   single_release <date>, track_release <date>, danceability <dbl>,
#> #   energy <dbl>, key <int>, loudness <dbl>, mode <int>, speechiness <dbl>,
#> #   acousticness <dbl>, instrumentalness <dbl>, liveness <dbl>, valence <dbl>,
#> #   tempo <dbl>, time_signature <int>, duration_ms <int>, explicit <lgl>,
#> #   key_name <chr>, mode_name <chr>, key_mode <chr>, lyrics <list>

Finally, there is a small data set, taylor_albums, summarizing Taylor’s album release history.

taylor_albums
#> # A tibble: 17 × 5
#>    album_name                    ep    album_release metacritic_score user_score
#>    <chr>                         <lgl> <date>                   <int>      <dbl>
#>  1 Taylor Swift                  FALSE 2006-10-24                  67        8.4
#>  2 The Taylor Swift Holiday Col… TRUE  2007-10-14                  NA       NA  
#>  3 Beautiful Eyes                TRUE  2008-07-15                  NA       NA  
#>  4 Fearless                      FALSE 2008-11-11                  73        8.4
#>  5 Speak Now                     FALSE 2010-10-25                  77        8.6
#>  6 Red                           FALSE 2012-10-22                  77        8.6
#>  7 1989                          FALSE 2014-10-27                  76        8.3
#>  8 reputation                    FALSE 2017-11-10                  71        8.3
#>  9 Lover                         FALSE 2019-08-23                  79        8.4
#> 10 folklore                      FALSE 2020-07-24                  88        9  
#> 11 evermore                      FALSE 2020-12-11                  85        8.9
#> 12 Fearless (Taylor's Version)   FALSE 2021-04-09                  82        8.9
#> 13 Red (Taylor's Version)        FALSE 2021-11-12                  91        8.9
#> 14 Midnights                     FALSE 2022-10-21                  85        8.3
#> 15 Speak Now (Taylor's Version)  FALSE 2023-07-07                  81        9.2
#> 16 1989 (Taylor's Version)       FALSE 2023-10-27                  90       NA  
#> 17 THE TORTURED POETS DEPARTMENT FALSE 2024-04-19                  90       NA

Code of Conduct

Contributions are welcome. To ensure a smooth process, please review the Contributing Guide. Please note that the taylor project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.

taylor's People

Contributors

abcasada avatar ericwu17 avatar hadley avatar scarioscia avatar wjakethompson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

taylor's Issues

Release taylor 3.0.0

Prepare for release:

  • git pull
  • Check current CRAN check results
  • Check if any deprecation processes should be advanced, as described in Gradual deprecation
  • Polish NEWS
  • urlchecker::url_check()
  • devtools::build_readme()
  • devtools::check(remote = TRUE, manual = TRUE)
  • devtools::check_win_devel()
  • revdepcheck::revdep_check(num_workers = 4)
  • Update cran-comments.md
  • git push
  • Draft blog post

Submit to CRAN:

  • usethis::use_version('major')
  • devtools::submit_cran()
  • Approve email

Wait for CRAN...

  • Accepted 🎉
  • Add preemptive link to blog post in pkgdown news menu
  • usethis::use_github_release()
  • usethis::use_dev_version(push = TRUE)
  • Finish blog post
  • Tweet

NEW ALBUM ALERT: Tortured Poets Department

Checklist of things that should be updated when adding a new album:

  • Add lyrics to data-raw/lyrics
  • Add singles and release dates to data-raw/releases.xlsx
  • Add Spotify album code to data-raw/taylor-lyrics.R (~ line 250)
  • Run data-raw/taylor-lyrics.R
  • Add album cover to inst/album-covers using data-raw/album-covers.R
  • Add color palette to R/taylor-album-palettes.R
  • Add color to existing album_compare palette in R/taylor-album-palettes.R
  • Update album_levels in R/taylor-album-palettes.R
  • Add palette to taylor_col() functionality in R/taylor-album-palettes.R
  • Update CSS for pkgdown theme
  • Create new hex logo, update favicons
  • Add tests for new palettes to tests/testthat/test-ggplot2-color-scales.R

NEW ALBUM ALERT: Speak Now (Taylor's Version)

Checklist of things that should be updated when adding a new album:

  • Add lyrics to data-raw/lyrics
  • Add singles and release dates to data-raw/releases.xlsx
  • Add metacritic score to bottom of data-raw/taylor-lyrics.R
  • Run data-raw/taylor-lyrics.R
  • Add album cover to inst/album-covers using data-raw/album-covers.R
  • Add color palette to R/taylor-album-palettes.R
  • Add color to existing album_compare palette in R/taylor-album-palettes.R
  • Update album_levels in R/taylor-album-palettes.R
  • Add palette to taylor_col() functionality in R/taylor-album-palettes.R
  • Update CSS for pkgdown theme
  • Create new hex logo, update favicons
  • Add tests for new palettes to tests/testthat/test-ggplot2-color-scales.R

NEW ALBUM ALERT: Midnights

Checklist of things that should be updated when adding a new album:

  • Add lyrics to data-raw/lyrics
  • Add singles and release dates to data-raw/releases.xlsx
  • Add metacritic score to bottom of data-raw/taylor-lyrics.R
  • Run data-raw/taylor-lyrics.R
  • Add album cover to inst/album-covers using data-raw/album-covers.R
  • Add color palette to R/taylor-album-palettes.R
  • Add color to existing album_compare palette in R/taylor-album-palettes.R
  • Update album_levels in R/taylor-album-palettes.R
  • Add palette to taylor_col() functionality in R/taylor-album-palettes.R
  • Update CSS for pkgdown theme
  • Create new hex logo, update favicons
  • Add tests for new palettes to tests/testthat/test-ggplot2-color-scales.R

Strange characters lyrics

Please briefly describe your problem and what output you expect. Please include a minimal reproducible example (AKA a reprex). If you've never heard of a reprex before, start by reading https://www.tidyverse.org/help/#reprex.


Some lyrics in newer albums have strange characters. For example, the 'e' in the phrase "a brave man" in the song The Black Dog is not a ASCII 'e' but instead some other type of 'e'. This means that if we use grep (or and IDE search feature) to look for the phrase "a brave man", no results are found, even when the phrase is used in the song The Black Dog.

I have previously made a pull request (#2) which added a python script to catch these types of errors, but it seems like the script was not run since the addition of new lyrics.

Having the correct encoding of the lyrics is important to me, since this repository is the upstream for a lyric completion game that I maintain (I am in the process of adding lyrics for TTPD).

Observed behavior:

$ grep -R "a brave man" .

Expected behavior:

$ grep -R "a brave man" .
./data-raw/lyrics/11a_the-tortured-poets-department-the-anthology/17_the-black-dog.txt:You said I needed a brave man

Add "Birch" to singles

From Big Red Machine's How Long Do You Think It's Goinna Last?

Renegade is already included

Release taylor 0.2.0

First release:

Prepare for release:

  • devtools::build_readme()
  • urlchecker::url_check()
  • devtools::check(remote = TRUE, manual = TRUE)
  • devtools::check_win_devel()
  • rhub::check_for_cran()
  • Review pkgdown reference index for, e.g., missing topics
  • Draft blog post

Submit to CRAN:

  • usethis::use_version('minor')
  • devtools::submit_cran()
  • Approve email

Wait for CRAN...

  • Accepted 🎉
  • usethis::use_github_release()
  • usethis::use_news_md()
  • usethis::use_dev_version()
  • Update install instructions in README
  • Finish blog post
  • Tweet
  • Add link to blog post in pkgdown news menu

Release taylor 2.0.0

Prepare for release:

  • git pull
  • Check current CRAN check results
  • Check if any deprecation processes should be advanced, as described in Gradual deprecation
  • Polish NEWS
  • devtools::build_readme()
  • urlchecker::url_check()
  • devtools::check(remote = TRUE, manual = TRUE)
  • devtools::check_win_devel()
  • rhub::check_for_cran()
  • revdepcheck::revdep_check(num_workers = 4)
  • Update cran-comments.md
  • git push
  • Draft blog post

Submit to CRAN:

  • usethis::use_version('major')
  • devtools::submit_cran()
  • Approve email

Wait for CRAN...

  • Accepted 🎉
  • git push
  • usethis::use_github_release()
  • usethis::use_dev_version()
  • git push
  • Finish blog post
  • Tweet
  • Add link to blog post in pkgdown news menu

Release taylor 0.2.1

Prepare for release:

Submit to CRAN:

  • usethis::use_version('patch')
  • devtools::submit_cran()
  • Approve email

Wait for CRAN...

  • Accepted 🎉
  • usethis::use_github_release()
  • usethis::use_dev_version()

NEW ALBUM ALERT: Red (Taylor's Version)

Checklist of things that should be updated when adding a new album:

  • Add lyrics to data-raw/lyrics
  • Add singles and release dates to data-raw/releases.xlsx
  • Add metacritic score to bottom of data-raw/taylor-lyrics.R
  • Run data-raw/taylor-lyrics.R
  • Add album cover to inst/album-covers using data-raw/album-covers.R
  • Add color palette to R/taylor-album-palettes.R
  • Add color to existing album_compare palette in R/taylor-album-palettes.R
  • Add new album to factor levels in R/taylor-album-palettes.R
  • Update CSS for pkgdown theme
  • Create new hex logo, update favicons
  • Add tests for new palettes to tests/testthat/test-ggplot2-color-scales.R

Add documentation about working with lyrics data

Thanks so much for your work on this package! It's awesome.

I have 2 student groups who are working with this data for their final projects, and they were trying to figure out how to analyze the lyrics data included in taylor_album_songs, but they were getting stumped by the fact that the lyrics column contains nested data (shown below).

Screenshot 2023-11-28 at 1 15 16 PM
Screenshot 2023-11-28 at 1 15 36 PM

We figured out that you can unnest() the lyrics data, so that everything is included in the same dataframe, which is useful for basic text analysis (such as with tidytext).

taylor_df_with_lyrics <- taylor_album_songs %>% unnest(lyrics)

Screenshot 2023-11-28 at 1 16 45 PM

That was helpful for my students, so I thought it might be useful to include a couple of sentences in the documentation about the fact that the lyrics are nested, and maybe include an example of how users might unnest the data.

Thanks again!

Album comparison palette

Create a color_palette object that includes one color for each album.

Add a wrapper around ggplot2::scale_fill_manual() and ggplot2::scale_colour_manual() that will automatically assign the color to the album.

Release taylor 1.0.0

Prepare for release:

  • Check current CRAN check results
  • Polish NEWS
  • devtools::build_readme()
  • urlchecker::url_check()
  • devtools::check(remote = TRUE, manual = TRUE)
  • devtools::check_win_devel()
  • rhub::check_for_cran()
  • revdepcheck::revdep_check(num_workers = 4)
  • Update cran-comments.md
  • Review pkgdown reference index for, e.g., missing topics
  • Draft blog post

Submit to CRAN:

  • usethis::use_version('major')
  • devtools::submit_cran()
  • Approve email

Wait for CRAN...

  • Accepted 🎉
  • usethis::use_github_release()
  • usethis::use_dev_version()
  • Finish blog post
  • Tweet
  • Add link to blog post in pkgdown news menu

Release taylor 2.0.1

Prepare for release:

  • git pull
  • Check current CRAN check results
  • Polish NEWS
  • devtools::build_readme()
  • urlchecker::url_check()
  • devtools::check(remote = TRUE, manual = TRUE)
  • devtools::check_win_devel()
  • rhub::check_for_cran()
  • revdepcheck::revdep_check(num_workers = 4)
  • Update cran-comments.md
  • git push

Submit to CRAN:

  • usethis::use_version('patch')
  • devtools::submit_cran()
  • Approve email

Wait for CRAN...

  • Accepted 🎉
  • git push
  • usethis::use_github_release()
  • usethis::use_dev_version()
  • git push

Release taylor 3.0.0

Prepare for release:

  • git pull
  • Check current CRAN check results
  • Check if any deprecation processes should be advanced, as described in Gradual deprecation
  • Polish NEWS
  • urlchecker::url_check()
  • devtools::build_readme()
  • devtools::check(remote = TRUE, manual = TRUE)
  • devtools::check_win_devel()
  • revdepcheck::revdep_check(num_workers = 4)
  • Update cran-comments.md
  • git push
  • Draft blog post

Submit to CRAN:

  • usethis::use_version('major')
  • devtools::submit_cran()
  • Approve email

Wait for CRAN...

  • Accepted 🎉
  • Add preemptive link to blog post in pkgdown news menu
  • usethis::use_github_release()
  • usethis::use_dev_version(push = TRUE)
  • Finish blog post
  • Tweet

Preserve names when creating a color palette

Currently all colors are converted and displayed as hexadecimal values:

library(taylor)

color_palette(c("firebrick", "wheat", "#0051ba"))
#> <color_palette[3]>
#>     #B22222 
#>     #F5DEB3 
#>     #0051ba

Created on 2021-10-18 by the reprex package (v2.0.0)

Would be nice if names were preserved, e.g.,

color_palette(c("firebrick", "wheat", "#0051ba"))
#> <color_palette[3]>
#>     firebrick
#>     wheat
#>     #0051ba

Similarly, could be good to preserve named vectors as well. For example,

ku_colors <- c(ku_blue = "#0051ba", crimson = "#e8000d", jayhawk_yellow = "#ffc82d")

color_palette(c("firebrick", "wheat", "#0051ba"))
#> <color_palette[3]>
#>     ku_blue
#>     crimson
#>     jayhawk_yellow

NEW ALBUM ALERT: 1989 (Taylor's Version)

Checklist of things that should be updated when adding a new album:

  • Add lyrics to data-raw/lyrics
  • Add singles and release dates to data-raw/releases.xlsx
  • Add Spotify album code to data-raw/taylor-lyrics.R (~ line 250)
  • Run data-raw/taylor-lyrics.R
  • Add album cover to inst/album-covers using data-raw/album-covers.R
  • Add color palette to R/taylor-album-palettes.R
  • Add color to existing album_compare palette in R/taylor-album-palettes.R
  • Update album_levels in R/taylor-album-palettes.R
  • Add palette to taylor_col() functionality in R/taylor-album-palettes.R
  • Update CSS for pkgdown theme
  • Create new hex logo, update favicons
  • Add tests for new palettes to tests/testthat/test-ggplot2-color-scales.R

New feature

Reminder to add Taylor's feature on "The Alcott" from The National's First Two Pages of Frankenstein when it is released on 2023-04-28.

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.