A comprehensive set of tools for downloading BoardGameGeek (BGG) rules threads and automatically converting these discussion logs into formatted Google Documents. This makes it easier to feed them into a LLM model like NotebookLM.
This project contains three main applications, supported by configuration and requirement files:
download_threads.py: A CLI Python script that fetches and saves all discussion topics from a specific game's BGG "Rules" forum as XML files securely to your local machine.upload_to_gdocs.py: A CLI Python script that parses the saved XML threads, converts them automatically into structured, readable HTML with properly formatted chat logs, and uploads them as new Google Docs to your Google Drive.app.py: A user-friendly desktop Graphic User Interface (GUI) wrapper that allows you to easily run the Download and Upload operations without needing to touch the command line.
Ensure you have Python 3.x installed on your computer. Install all necessary dependencies by running:
pip install -r requirements.txtTo download threads from BGG, you need a Bearer Token.
- Create a file named
.envin the root of the project directory. - Add your token inside the file:
BGG_BEARER_TOKEN=your_bgg_api_token_here CREDENTIALS_PATH=credentials.json
To upload directly to Google Drive/Docs, you must configure OAuth Desktop application credentials.
- Go to the Google Cloud Console.
- Create or select a Project and enable both the Google Drive API and Google Docs API.
- Go to Credentials -> Create Credentials -> OAuth client ID -> Desktop app.
- Download the generated
.jsonfile and securely store it. By default, the scripts look forcredentials.jsonin the project root folder, but you can configure this path dynamically. (Note: When you run the upload script for the very first time, it will open your web browser to authenticate your Google Account and generate a localtoken.jsonfile for future uses).
The easiest way to use these tools is through the graphical interface.
Running the app:
python app.pyHow to use:
- GAME_ID: Input the BGG target game ID (e.g.,
13for Catan) found in its main URL. - Base Folder / Folder: Use the
Browsebutton to select a local output/input directory. - Auto-generate sub-folder from Game Name: When checked (default), automatically creates a subfolder formatted as
Game Name (GAME_ID)inside your Base Folder, avoiding manual folder creation for each game. - Credentials: Use the
Browsebutton to select your Google OAuthcredentials.jsonfile. - DOWNLOAD: Triggers
download_threads.pyusing your selected ID and folder. - UPLOAD: Triggers
upload_to_gdocs.pyusing your selected folder & credentials. - The logs and progress are seamlessly printed to the application output window at the bottom.
You can bypass the GUI and use the raw scripts directly. Both scripts can utilize default properties configured inside config.py:
# config.py
DEFAULT_GAME_ID = "13"
DEFAULT_OUTPUT_FOLDER = r"D:\path\to\your\output_folder"This script uses "smart syncing"—checking local files against the remote server so it only downloads threads with new or updated numbers of posts. It automatically respects API rate limitations.
Run with configured defaults:
python download_threads.pyRun with CLI overrides:
python download_threads.py --game_id 174430 --output_folder ./gloomhaven_rulesRun with Automatic Folder Generation:
python download_threads.py --game_id 174430 --output_folder ./downloads --auto_folderThis will fetch the game name and automatically place the threads inside ./downloads/Gloomhaven (174430).
This script takes a folder of BGG XML discussions and stitches them into an extensive HTML structured stream with subjects and chat logs. If a compiled document exceeds the Google Docs character limit (approx 1M characters), the script will automatically split it into consecutive "Part X" documents to avoid API upload failures.
Run with configured default input folder:
python upload_to_gdocs.pyRun with CLI override:
python upload_to_gdocs.py --input_folder ./gloomhaven_rules --credentials_path ./my_creds.jsonRun using a Game ID to automatically find the folder:
python upload_to_gdocs.py --input_folder ./downloads --game_id 174430 --credentials_path ./my_creds.jsonWhen --game_id is provided, the script searches the --input_folder for a subfolder ending in (174430) and will omit the game ID from the final uploaded Google Docs title.
