A python-coded app allowing you populate a local database of your collection and narrow down your choices for a game night. Good times.
An SQLite DB (empty XML creation example included) containing a user's board game collection information (exportable from BoardGameGeek) in several tables:
- Game List - basic information displayed on the BGG header
- Expansions - tagged, and therefore stored, separately from the main games
- Ancillary tables - mechanics, categories, etc., which must be obtained through the BGG API
After this DB is populated, running the streamlit
app will allow you to randomly pick and/or narrow down choices fitting specific criteria.
pandas
streamlit
Other packages (sqlite3
, xml
, requests
, etc.) should be part of the standard python library, but may be pip install
ed if needed.
First, ensure that your DB path is specified in both data_populate/sql_tasks.py
and game_picker/sql_pull.py
and you fill out your BGG username in data_populate/data_retrieve.py
.
The data_populate
folder serves two functions relating to the database filling:
- Compare your current BGG game list to what's in the database, retrieve base information on any missing, assigning them sequential IDs in SQLite
- Populate category, designer, etc. tables based on the XML from BGG
cd game-works/data_populate
python3 main.py
This will populate the main and auxiliary tables with mechanics, categories, etc. A sleep
function is included to not overwhelm the BGG API
Locally running the picker app just involves activating streamlit - this will warm the cache on first go and allow the app to be network-accessible.
cd game-works/game_picker
streamlit run game_picker.py