GitHub - rgrwkmn/shredster: A Game-Card Generator inspired by Hitster that can load data from Spotify playlists or CSV. Includes a command line game so it can be played without printing the cards. · GitHub
Skip to content

About

A Game-Card Generator inspired by Hitster that can load data from Spotify playlists or CSV. Includes a command line game so it can be played without printing the cards.

Resources

Stars

0 stars

Watchers

0 watching

Forks

 
 

Repository files navigation

Shredster

Introduction

Shredster is a program for creating custom Hitster song cards. It is a fork of the SongSeeker Card Generator, a Python script designed to create visual cards based on song data. See the SongSeeker project for the original.

Shredster adds the ability to pull data from Spotify for ease of creating shredster decks to play with. It also adds a way to play without printing cards, although you will still need something physical to track your timelines, such as sticky notes or index cards.

Features

  • Generate cards for songs with a QR code on one side and the song info on the other.
  • PDF output for double sided printing.
  • Input data in CSV format.
  • Scrape data from Spotify songs and/or playlists.
  • Play without printing cards via game.py.

Usage Examples

Save Spotify Playlist and Start Game

python generatePlayCardsFromSpotify.py https://open.spotify.com/playlist/6KQrlKHRIkn42J02uXAFdG data/example.csv
python game.py data/example.csv

Generate PDF from Spotify Playlist

python generatePlayCardsFromSpotify.py https://open.spotify.com/playlist/6KQrlKHRIkn42J02uXAFdG pdfs/example.pdf

Generate PDF from CSV

python generatePlayCardsFromCSV.py data/example-youtube-songs.csv pdfs/example.pdf

Full usage documentation can be found below.

Prerequisites

Make sure you have Python installed on your system. The script is tested with Python 3.11 and above. You can download and install Python from here.

Installation

Clone the repository to your local machine using the following command:

git clone https://github.com/rgrwkmn/shredster

Navigate to the cloned directory:

cd shredster

Create a python virtualenv:

python -m venv ./venv

Activate the virtualenv

source venv/bin/activate

Install the required Python packages:

pip install -r requirements.txt

CSV Usage

Generate Cards from CSV

python generatePlayCardsFromCsv.py <input_csv_path> <output_pdf_path>

Example

python generatePlayCardsFromCsv.py data/example-youtube-songs.csv example.pdf

Icon

You can also add an icon to the card by using the --icon flag:

# Add icon from a url
python generatePlayCardsFromCsv.py data/example-youtube-songs.csv example.pdf --icon https://github.com/andygruber/songseeker/blob/main/icons/icon-96x96.png?raw=true
# Add icon from a local file
python generatePlayCardsFromCsv.py data/example-youtube-songs.csv example.pdf --icon ../songseeker/icons/icon-96x96.png

Pagesize

You can set the pagesize to A4 or letter based on your printer page size. The default is letter.

python generatePlayCardsFromCsv.py data/example-youtube-songs.csv example.pdf --pagesize=A4

CSV Input Format

The input CSV file should have the following format:

  • Title: The title of the song.
  • Artist: The artist of the song.
  • Year: The release year of the song.
  • URL: The YouTube URL of the song. If the song does not start at the beginning of the video, you may also add the starting time in seconds to the end of the link, like ?t=16.

Make sure your CSV file includes headers and the data is separated by commas.

An example can be found in data/example-youtube-songs.csv.

Spotify Usage

Web API Credentials

First, you will need to have a Spotify Web API client ID and secret for API access by creating a Spotify App. Copy the spotifyauth.example.json file to spotifyauth.json and paste your credentials in there.

There are a few ways to use the generatePlayCardsFromSpotify.py script. When generating a PDF, the --icon and --pagesize options are the same as generatePlayCardsFromCsv.py detailed above.

From Playlist URL

Simply provide the URL of a public spotify playlist

python generatePlayCardsFromSpotify.py https://open.spotify.com/playlist/6KQrlKHRIkn42J02uXAFdG pdfs/spotify.pdf

From Text File with Song and/or Playlist URLs

Paste as many song and playlist URLs as you like on separate lines into a .txt file and load that. Handy if you want to put together a bunch of songs and playlists. See data/example-spotify.txt for an example.

python generatePlayCardsFromSpotify.py data/example-spotify.txt pdfs/spotify.pdf

From Directory of .txt files

Give a directory path and it will load all .txt files in that directory. Handy if you want to create a game from multiple contributors and attribute the source of each song.

python generatePlayCardsFromSpotify.py data pdfs/spotify.pdf

Output CSV

If the output path ends in .csv it will save a CSV file of the song data instead of creating a PDF. Use this if you want to save the data locally to play with game.py. You can also open the CSV to fine tune the data if you find that anything is inaccurate.

python generatePlayCardsFromSpotify.py data/example-spotify.txt data/spotify.csv

Spotify Song Selection Guidelines

Since the Spotify functionality automatically pulls the song Artists, Title, and Year, it's important to select the right version of a Song to get accurate information.

Choose the song from its original album release

The data for the song's release year comes from its album release year. So if you choose a song from a compilation such as a Best Of album, the release year will not be correct. Remasters and Reissues have had the original release year in my experience, so those should be OK to use.

If you can't find the song you want in its original version on Spotify, you can always save from Spotify to CSV and edit the info from there before generating a PDF or playing with game.py.

Playing the Game

See the Official Hitster Rules for overall gameplay rules.

Printing and Playing

Print a test page with just a few songs on it first to make sure you have the PDF page size and double sided print settings correct! When you are sure the print is coming out correctly, print all of your cards and cut them out.

Playing with printed cards is the same as playing regular Hitster, except instead of scanning the cards with the Hitster app, you will scan them with your phone camera QR code scanner. Depending on how the songs are being played, the person doing the scanning may need to quickly put their phone down so they don't see the song info.

Playing with game.py

Instead of printing, you can run game.py from the command line and it will act as a virtual deck. Simply create a CSV or save your Spotify playlist or songs to a CSV.

python game.py data/example-youtube-songs.csv

It will show you how many cards are in the deck, how many are in the "discard pile", and the QR code side of the current card.

Deck:  58 , Discard: 0

                                         
                                         
    █▀▀▀▀▀█ █▄██ ██ ▄▄▀▄▄█▄ ▄ █▀▀▀▀▀█    
    █ ███ █ ▀ ▀█▀▀█ █ ▄▄█▀ █▄ █ ███ █    
    █ ▀▀▀ █ ▀ ▀▀██ ██▀█▀▄███▄ █ ▀▀▀ █    
    ▀▀▀▀▀▀▀ ▀▄▀ █▄▀▄█ ▀ █ █ █ ▀▀▀▀▀▀▀    
    ▀  ██▀▀▀█▄ ▀▀▄▄▄▀█▄▄▄▄ ▄█▀  █▄█▀█    
    █ ▀██▀▀▀▀█▄▀██ ▀█ ▄   ▄▀▀█▀▄▀▀█▀█    
    ▄▀▄▄▀▀▀▀█ █▄ █▄▀ █▄▄▀▀▄   ▀     ▀    
    █▀▀▄█▄▀▄▀▀█▄ ▄▄▀▄▀ █ ▀█▄▀▄▀ ▄█▄ ▄    
    ▀██▀▀▀▀ ▄▄▀█ ▀ █ ▄▄▄▄ █▀▀▀█▀█▀▄▄▄    
    ▀   ▄▄▀▄▀▄▄█▄ ▀█▀▀▀▀▀▀ ▀ ▄█▀▄██▀█    
    ██▄▀ ▄▀▀ ▄ █▄█ ▀▀▄▀▀ ▄▄▄   █▄█ ▀     
    █ ▀ ▄█▀█▀█ ▀▄  ▄ █    ▀▀ █▄▀█ ▄█▀    
    ▀▀  ▀▀▀▀▄▀ ▀▀█ ▄▄▄█▀▀▄▄▀█▀▀▀█ █ ▀    
    █▀▀▀▀▀█ █▀▄▀▄▄ ▀▀█▄▀█  ██ ▀ █▄██     
    █ ███ █ █▀▄   ▄▀█▀▄█  ████▀█▀▄▄█▄    
    █ ▀▀▀ █  ▄▀█▀ ▀▀   ▀ ▀ █▀ ▄██▄▄██    
    ▀▀▀▀▀▀▀ ▀▀  ▀▀▀▀ ▀ ▀   ▀▀ ▀▀▀        
                                         

Use the right arrow to reveal the song info side of the card.

Deck:  58 , Discard: 0

Title: American Canon

Artist: Wolfsmyth

Year: 2018

Source: spotify

Use the right arrow again to show the QR code of the next card.

Deck:  57 , Discard: 1

                                         
                                         
    █▀▀▀▀▀█ █▀▄ ▄ ▄ █▀▀▀█ ██  █▀▀▀▀▀█    
    █ ███ █ ▄███ ▀▀█▀ ▄▄▀ ███ █ ███ █    
    █ ▀▀▀ █  ▀ █ ▀ ▄██ █▄▄▄▀▀ █ ▀▀▀ █    
    ▀▀▀▀▀▀▀ █▄▀▄█ ▀▄█▄█▄▀ █ ▀ ▀▀▀▀▀▀▀    
    ▀ █▀ ▀▀▀ ▀▄  ▄ ▀████ ▀▄▄▄ █▄ █▄██    
    ▄█▀▄▀▀▀█▀▀ █ ▀  █▄▀▄ ▀▀█▄█▀█▀█ ▄▀    
     ▀█▀ █▀ ▄ █▀▄ █▀▀  █  ▄▀█▄ ▄▀█▄█     
    ▄▀ █▀▄▀▀ ▄▀█ ▄ ▄ ▀▀█▄▄▀ ▀▄█▄ ▄▄      
     ▀█ ██▀█▄█▀▀██ ▄  ▀ ▄▀██▄██ ██  ▄    
    ▀ ▀ ▀▄▀▀ ▄     █ ▄█▄   ▄▄▄█▀█ ▀      
    ▄▀  █ ▀▀▄ ▄█ ▄▀▄█▄ ██▀█ ▀█▄▀ ▀█ ▄    
     ▄ █▄▀▀█ ▄ ▀█▄ █ ▀█▄█▀▀█▀▀▄███▀▀▀    
    ▀     ▀▀█▀▀▄█ ▀▄█▀▀▄  ███▀▀▀█▄▀█     
    █▀▀▀▀▀█ █▀ ▀██ ▄███▀▀▄ ██ ▀ █▄▄█▄    
    █ ███ █ ▄▀▄  ▄  ██▀▀  █▀▀▀▀█▀▄█▀▄    
    █ ▀▀▀ █ ▀▄ ▀▄█ ▀▀█▄ █▀▀▄█▀▀█▄▀▀ ▄    
    ▀▀▀▀▀▀▀ ▀  ▀ ▀▀  ▀▀▀ ▀ ▀ ▀  ▀        
                                         

You can continue navigating forward through the deck with the right arrow, or go back with the left arrow.

You will need to reveal one card per player to start the game. Players should write down their song info on sticky notes, index cards, etc. in order to build their timelines.

Contributing

Contributions are welcome.

License

This project is licensed under the AGPL-3.0 license - see the LICENSE file for details.

About

A Game-Card Generator inspired by Hitster that can load data from Spotify playlists or CSV. Includes a command line game so it can be played without printing the cards.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages