Skip to main content

A Python interface to boardgamegeek.com's API

Project description

https://travis-ci.org/lcosmin/boardgamegeek.svg?branch=master https://coveralls.io/repos/lcosmin/boardgamegeek/badge.png?branch=master

Introduction

boardgamegeek is a Python library which makes it easy to access data off 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

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

Quick Install

To install boardgamegeek, just use pip:

> pip install boardgamegeek

Documentation

Documentation is available at http://boardgamegeek.readthedocs.org/

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")
...
安卓纪元:矩阵潜袭

If you want to use the disk cache:

>>> bgg = BoardGameGeek(cache="sqlite:///tmp/cache.db?ttl=3600&fast_save=0")
>>> g = bgg.game("Celtica")
>>> g.id
21293

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

  • Improve documentation :)

  • Improve unit testing

Contributions/suggestions are welcome.

Changelog

0.0.12

Features

  • Added some basic argument validation to prevent pointless calls to BGG’s API

  • When some object (game, user name, etc.) is not found, the functions return None instead of raising an exception

0.0.11

Features

  • Collections and Guilds are now iterable

Bugfixes

  • Fixed __str__ for Collection

0.0.10

Features

  • Updated documentation

  • Improved Python 3.x compatibility (using unicode_literals)

  • Added Travis integration

Bugfixes

  • Fixed float division for Python 3.x

0.0.9

Features

  • Added support for retrieving an user’s buddy and guild lists

  • Started implementing some basic unit tests

Bugfixes

  • Fixed handling of non-existing user names

  • Properly returning the maximum number of players for a game

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

boardgamegeek-0.0.12.tar.gz (14.4 kB view details)

Uploaded Source

File details

Details for the file boardgamegeek-0.0.12.tar.gz.

File metadata

File hashes

Hashes for boardgamegeek-0.0.12.tar.gz
Algorithm Hash digest
SHA256 ee21d8a7f398aef05766342ad2cb415cfa03a759ca6de61511d357b9cd14054b
MD5 25bb1f9c057fac78f00e5fb6c2a6bc7a
BLAKE2b-256 bff0d4d90d412b0bccf3ea75b3f81e1a5fc21847be4cdc136be6052c81682687

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page