BGG-API¶
A Python API wrapper for BoardGameGeek
Note
The documentation is a work in progress. You can check out the unit tests for examples on how to use the library.
Introduction¶
bgg-api is a Python wrapper to easily access data from BoardGameGeek XML API.
It’s continuation of boardgamegeek2, which is an almost completely rewritten fork of libBGG.
Table of Contents¶
- Modules
boardgamegeek.api- Core functionsBGGClientboardgamegeek.collection- Collection informationCollectionboardgamegeek.exceptions- Exceptionsboardgamegeek.games- Games informationCollectionBoardGameBoardGameBoardGameRankPlayerSuggestionBoardGameStatsBoardGameCommentBoardGameVideoBoardGameVersionboardgamegeek.guild- Guild informationGuildboardgamegeek.hotitems- BoardGameGeek “Hot Items”HotItemHotItemsboardgamegeek.plays- BoardGameGeek “Plays”GamePlaysUserPlaysPlaySessionPlaysessionPlayerboardgamegeek.search- Search resultsSearchResultboardgamegeek.things- Generic objectsThingboardgamegeek.user- BoardGameGeek “Users”Userboardgamegeek.utils- Generic helper functionsDictObjectRateLimitingAdapterfix_url()get_link_by_type()request_and_parse_xml()xml_subelement_attr()xml_subelement_attr_list()xml_subelement_text()
- Changelog
- 1.1.13
- 1.1.12
- 1.1.11
- 1.1.10
- 1.1.9
- 1.1.8
- 1.1.7
- 1.1.6
- 1.1.5
- 1.1.4
- 1.1.3
- 1.1.2
- 1.1.1
- 1.1.0
- 1.0.1
- 1.0.0
- 0.13.2
- 0.13.1
- 0.13.0
- 0.12.1
- 0.12.0
- 0.11.2
- 0.11.1
- 0.11.0
- 0.10.1
- 0.10.0
- 0.9.0
- 0.8.1
- 0.8.0
- 0.7.1
- 0.7.0
- 0.6.0
- 0.5.0
- 0.4.3
- 0.4.2
- 0.4.0
- 0.3.0
- 0.2.0 (unreleased)
- 0.1.0
- 0.0.14
- 0.0.13
- 0.0.12
- 0.0.11
- 0.0.10
- 0.0.9
Features¶
This library exposes (as Python objects with properties) the following BoardGameGeek entities:
Games
Users
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.
BoardGameGeek API documentation can be found here
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.
Installation¶
pip install bgg-api
Usage¶
Obtain access token here: https://boardgamegeek.com/applications
from boardgamegeek import BGGClient
bgg = BGGClient("access_token")
game = bgg.game("Monopoly")
print(game.year) # 1935
print(game.rating_average) # 4.36166
TODO¶
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!
Credits¶
Original authors:
Cosmin Luță (github:lcosmin)
Phil S. Stein (github:philsstein)
Geoff Lawler (github:glawler)
Contributions to this fork:
Tom Usher (github:tomusher)
Brent Ropp (github:bar350)
Michał Machnicki (github:machnic)
Philip Kendall (github:pak21)
David Feng (github:selwyth)
Emil Stenström (github:EmilStenstrom)
Bill Sacks (github:billsacks)
Arnauld Van Muysewinkel (github:arnauldvm)