Boardgamegeek Backups

Some old notes on pulling data from BGG...

Backing up BGG Geeklists is something I've casually wondered about. Digging around, I discovered Andrea Nand's BGG1tool (yes, the Nandeck guy). This tool allows you to pull quite a bit of data. My Geeklist CSV had issues because BGG1tool uses comma separation by default (couldn't figure out how to change this) and I had commas in my summary contents, but a bit of formula magic allowed me to cobble together a CSV with all the data I needed.

I looked into using Hugo to template the data to HTML, but I knew I would have to relearn a bunch of stuff. I ended up going with the pandas Python library for a quick and easy solution.

import pandas as pd

#read csv file 
csv_data = pd.read_csv(r"C:\Users\neonaut\Downloads\bgg1toolu\pnpgeeklist-updated.csv",sep ='\t')

#set index to 1 instead of 0
csv_data.index = csv_data.index + 1

#save as html file
csv_data.to_html("csv_table.htm")

If you throw an error, this lets you skip:

pd.read_csv(r"file.csv",error_bad_lines=False, sep ='\t')

Once I had the means to pull the data relatively easily, I tried to think of ways to distinguish it. I thought it would be cool to add # of plays and build type. I was never able to figure out how to pull # plays ONLY for games on the Geeklist using the tool and my BGG collection doesn't include all the games I've built.

GeekGroup allows me to export a CSV of all plays, so I did that (I've played 237 games, yay for me). After messing around with both pandas and Python file reading capabilities, to no avail, I was able to merge the files based on duplicate Game IDs with this handy solution

merge=csv_data.merge(playlog,how="left",on="ID") merge.to_csv("merged.csv")

Using the above, I put together this PNP list sometime in early 2022. I've since built about 10 more games, but I'm not sure when I'll return to the hobby so I haven't gotten around to including them.