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 functionsBGGClient
boardgamegeek.collection
- Collection informationCollection
boardgamegeek.exceptions
- Exceptionsboardgamegeek.games
- Games informationCollectionBoardGame
BoardGame
BoardGameRank
PlayerSuggestion
BoardGameStats
BoardGameComment
BoardGameVideo
BoardGameVersion
boardgamegeek.guild
- Guild informationGuild
boardgamegeek.hotitems
- BoardGameGeek “Hot Items”HotItem
HotItems
boardgamegeek.plays
- BoardGameGeek “Plays”GamePlays
UserPlays
PlaySession
PlaysessionPlayer
boardgamegeek.search
- Search resultsSearchResult
boardgamegeek.things
- Generic objectsThing
boardgamegeek.user
- BoardGameGeek “Users”User
boardgamegeek.utils
- Generic helper functionsDictObject
RateLimitingAdapter
fix_url()
request_and_parse_xml()
xml_subelement_attr()
xml_subelement_attr_by_attr()
xml_subelement_attr_list()
xml_subelement_text()
- Changelog
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.
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¶
from boardgamegeek import BGGClient
bgg = BGGClient()
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)