boardgamegeek - A Python API for boardgamegeek.com

Note

The documentation is a work in progress. You can check out the unit tests for examples on how to use the library.

Introduction

boardgamegeek is a Python library which makes it easy to access data from BoardGameGeek using their official XML API.

It’s an almost completely rewritten fork of libBGG.

Features

This library exposes (as Python objects with properties) the following BoardGameGeek entities:

  • Users
  • Games
  • User collections
  • Player guilds
  • Plays
  • Hot items

requests-cache is used for locally caching replies in order to reduce the amount of requests sent to the server.

Note

The cache is enabled by default and it’s configured to use memory only. It’s also possible to use SQLite for a persistent cache.

Quick Install

To install boardgamegeek, just use pip:

> pip install boardgamegeek

Usage

Here’s a quick usage example:

>>> from boardgamegeek import BoardGameGeek
>>> bgg = BoardGameGeek()
>>> g = bgg.game("Android: Netrunner")
>>> g.name
'Android: Netrunner'
>>> g.id
124742
>>> for n in g.alternative_names: print n.encode("utf-8")
...
安卓纪元:矩阵潜袭

To Do

  • Not all the information exposed by the official API is stored into the Python objects. Need to improve this.
  • Try to support the other sites from the boardgamegeek’s family
  • Allow better control for configuring the cache
  • Improve documentation :)

Contributions/suggestions are welcome!

Contributions

  • Phil S. Stein (philsstein) (libBGG inspired this fork)
  • Tom Usher (tomusher)

Indices and tables