Skip to content

seanbreckenridge/albums

Repository files navigation

albums

A collection of CSV files containing popular/acclaimed albums, used to make a inordinate list of albums to listen to.

This started by me merging a bunch of lists of music to listen to:

None of these sources are particularly perfect or complete, but they make me to listen to some music I otherwise may have not given a chance. Only see it as slightly better than what I used to do in the past, i.e. scrolling through streaming services and picking whatever they happen to have featured. (Edit: as of now, am pretty comfortable using charts/recommendation lists to find things I'm more likely to be interested in, so will likely not update the Grammy/Mercury/AMA/Brit Awards from 2023 going forward, because I find my judgement for new music to be (slightly) better than what the award shows pick)

This contains code to interact with my spreadsheet -- listing the next albums I should listen to, validating the data using the Discogs API

An older version of this repo is pushed to albums_old -- became difficult to maintain due to size concerns/constantly syncing changes to giant SQL files. This maintains a request cache instead, using url_cache

If you just want the data, see csv_data. spreadsheets.csv can be used to make your own spreadsheet

nextalbums

The command that is installed by following the instructions below:

Usage: nextalbums [OPTIONS] COMMAND [ARGS]...

  Interact with my albums spreadsheet!

Options:
  --help  Show this message and exit.

Commands:
  discogs-update        use discogs to update sheet
  export                export sheet as JSON
  generate-csv          update spreadsheet.csv
  print-next            print next albums
  update-csv-datafiles  update csv datafiles

Three of those commands are related to updating the data files here:

This entire process is managed by me using ./update, which calls those in the required order to update all the data here

The part of this I use most often is nextalbums print-next, which prints the next albums from the spreadsheet I should listen to:

$ nextalbums print-next
+--------------------------------+---------------------------+------+
| Album                          | Artist                    | Year |
+--------------------------------+---------------------------+------+
| Aqua City                      | S. Kiyotaka & Omega Tribe | 1983 |
| F-1 Grand Prix World           | T-Square                  | 1992 |
| Serendipity 18                 | The Bob Florence Limited  | 1998 |
|                                | Edition                   |      |
| The Miseducation Of Lauryn     | Lauryn Hill               | 1998 |
| Hill                           |                           |      |
| This Is Hardcore               | Pulp                      | 1998 |
| This Is My Truth Tell Me Yours | Manic Street Preachers    | 1998 |
| Vol. 2... Hard Knock Life      | Jay-Z                     | 1998 |
| Vuelve                         | Ricky Martin              | 1998 |
| Wide Open Spaces               | Dixie Chicks              | 1998 |
| 13                             | Blur                      | 1999 |
+--------------------------------+---------------------------+------+

nextalbums export exports the entire active spreadsheet to JSON:

{
  "album_artwork_url": "https://i.discogs.com/2FN_VrOUSlSrOMhE7GDchtJlfNM1qI2dPZnE3blU1Nc/rs:fit/g:sm/q:40/h:150/w:150/czM6Ly9kaXNjb2dz/LWltYWdlcy9SLTI5/MzA2MjUtMTQzNzA1/NjYzNi01NzUxLmpw/ZWc.jpeg",
  "album_name": "Chet Baker Sings",
  "cover_artists": "Chet Baker",
  "discogs_url": "https://www.discogs.com/master/60289",
  "genres": [
    "Jazz"
  ],
  "listened_on": "2019-02-19",
  "main_artists": [
    31617
  ],
  "note": null,
  "reasons": [
    "NME's 500 Greatest Albums of All Time",
    "/mu/ Essentials"
  ],
  "score": 7.5,
  "styles": [
    "Cool Jazz"
  ],
  "year": 1954
}

I use that as part of my personal HPI modules, which lets me use its query interface:

$ hpi query 'my.nextalbums.history' \
  | jq -r '.[] | select(.score>=9) | "\(.album_name) - \(.cover_artists)"' \
  | head -n5
Paranoid - Black Sabbath
Untitled - Led Zeppelin
The Stranger - Billy Joel
Solid State Survivor - Yellow Magic Orchestra
The Wall - Pink Floyd

Sources for spreadsheet.csv:

Note for '1001 Albums You Must Hear Before You Die' and 'Rolling Stone's 500 Greatest Albums of All Time', the number of albums is above 1001 and 500 respectively, as there have been multiple versions of the book, and I've included anything that was ever on the list.

Note: The 'Rolling Stone's 500 Greatest of All Time' is a combination of the 2012 and earlier versions.

Installation:

Configuration for this is handled by modifying the settings.py file in this directory. Since that is just a python file, you're free to modify that to pull items out of environment variables (os.environ["ENVIRONMENT_VAR"]) or read/files do anything else. You can run the file (python3 settings.py) to print the computed settings

Note: To my knowledge, no one has ever done this yet, so if you have issues, feel free to open an issue

  1. Create your own copy of the spreadsheet.
  • You can open a new google sheet, and then File > Import spreadsheet.csv into a new google sheet.
  • I'd also recommend setting a fixed row height to ensure images are all the same size (You can do this by doing Ctrl/⌘ + A repeatedly till the margins are selected, and then resizing one row to your desired height.)
  • Name the sheet Music (near the bottom left)
  1. Clone this repository git clone https://github.com/seanbreckenridge/albums, and install it using pip install --editable ., installing it as an editable package. This won't work as normal pip install, it must be editable.
  2. Create a file named client_secret.json in the root directory which contains your credentials for a google sheets OAuth connection. Instructions for how to get your client_secret.json file here; download your created credentials from the Google credentials console
  3. Run python3 setup_credentials.py to authenticate this with the Google account you created the spreadsheet on
  4. Update the SPREADSHEET_ID variable in settings.py - the ID is after the /d/ in the URL when viewing it in Google Sheets
  5. (If you want to add albums and validate them with nextalbums discogs-update) Create a file discogs_token.yaml in the root directory (info can be found here, token here) with contents like:
user_agent: myPython3DiscogsClient/1.0
token: !!str FDJjksdfJkJFDNMoiweiIRWkj