Skip to content
This repository has been archived by the owner on Apr 10, 2023. It is now read-only.
/ bgg-ranks Public archive

Simple script that grabs board game data from BoardGameGeek via the BGG XML API2

License

Notifications You must be signed in to change notification settings

boldandbrad/bgg-ranks

Repository files navigation

BGG Ranks

Simple script that grabs Board Game data from BoardGameGeek.com via the BGG XML API2

NOTICE

The contents of this repo have been migrated to and greatly improved upon in meeple-cli. As a result, this repo is deprecated and will no longer receive updates.

Dependencies

Usage

  1. Create one or more .yaml source files inside ./in/ with the following format:

    # collection.yaml
    bgg-ids:
      - 266192 # BGG id ints
      - 266524
      - 290448

    BGG ids can be easily stripped from the board game or board game expansion page urls on boardgamegeek.com

  2. Run the bgg_ranks.py script:

    python bgg_ranks.py
  3. The script will create a .json output file for each source .yaml file in ./in/, with the following path and name:

    ./out/collection/yyyy-mm/yyyy-mm-dd.json

    Each output file contains lists of board game and expansion objects corresponding to the ids provided in the relevant source file. The 'boardgames' list will always be sorted by BGG rank in ascending order, while the 'expansions' list will always be sorted by BGG rating in descending order.

    {
      "boardgames": [
        {
          "name": "Wingspan",
          "year": "2019",
          "rating": 8.11,
          "rank": "21",
          "weight": 2.43,
          "id": 266192
        },
        {
          "name": "PARKS",
          "year": "2019",
          "rating": 7.84,
          "rank": "113",
          "weight": 2.16,
          "id": 266524
        }
      ],
      "expansions": [
        {
          "name": "Wingspan: European Expansion",
          "year": "2019",
          "rating": 8.42,
          "rank": "Not Ranked",
          "weight": 2.38,
          "id": 290448
        }
      ]
    }

Coming Soon

  • Additional script for aggregating output files into metrics
  • Multi-thread requests to api for extremely long id lists?
  • Optional csv output for copy/import into spreadsheets
  • Option/flag to sort 'boardgames' output by rating instead of rank

License

MIT

About

Simple script that grabs board game data from BoardGameGeek via the BGG XML API2

Topics

Resources

License

Stars

Watchers

Forks