This project automates the management of a Super Bowl Squares (Boxes) pool hosted on a Google Spreadsheet. It handles the randomization of score axes and helps fill the board by distributing available squares among existing participants.
- Smart Filling: specific logic to calculate and distribute remaining squares evenly among participants who have already selected a box.
- Randomized Axes: Generates and shuffles digits (0-9) for the horizontal and vertical score headers.
- Visual Feedback: Highlights auto-generated square assignments in yellow to distinguish them from manual entries.
- Google Sheets Integration: Uses
gspreadto read and write directly to a live Google Sheet.
- Python 3.x
- Google Cloud Service Account: You need a JSON key file for a service account with the Google Sheets API and Google Drive API enabled.
-
Install the required Python packages:
pip install gspread oauth2client
-
Credentials:
- Place your service account JSON key file in a secure location.
- Ensure the
secret_key_pathinsbb_generator.pypoints to this file. - Share the Spreadsheet: Open your Google Sheet and share it (Editor access) with the
client_emailaddress found inside your JSON key file.
Modify sbb_generator.py to match your environment:
spreadsheet_name: The name of your Google Sheet (e.g., "Super Bowl LX").secret_key_path: The absolute path to yoursecret_key.json.
- Open the Google Sheet.
- Enter the names of the participants into the main grid area (C3:L12).
- Run the script:
python sbb_generator.py
- The script will:
- Calculate the fill factor based on the number of existing names.
- Randomly assign empty cells to the existing participants.
- Highlight the newly assigned cells.
- Randomize the row and column headers (digits 0-9).
- Main Grid: Cells
C3:L12(10x10 grid). - Header Rows/Cols: Row 2 (columns 3-12) and Column 2 (rows 3-12) are reserved for the score digits.