Python client and CLI for the BoardGameGeek XML API
Project description
bgg-search
bgg-search is a Python package and command-line tool for querying the
BoardGameGeek XML API. It lets you search for board games
by name and retrieve full game details — player counts, play time, weight, BGG rating, and
more — from the command line or from your own Python code.
Contents:
Installation
pip install bgg-search
Requires Python ≥ 3.13.
A BGG API token is required to make requests. Obtain one by registering your application at https://boardgamegeek.com/applications.
The token is resolved in this order — the first source found is used:
--token-file PATH— CLI option pointing to a file containing the token.BGG_TOKEN— environment variable..bgg-token— plain-text file in the current working directory.
If none of the above is provided, the command exits with code 1 and prints an error to stderr.
Quickstart
CLI
export BGG_TOKEN=<your-token>
# Search for games matching a query
bgg-search search "Catan"
# 13 Catan
# 396790 Catan: New Energies
# ...
# Fetch full details for a game by its BGG ID
bgg-search details 13
# id: 13
# name: Catan
# year: 1995
# min_players: 3
# max_players: 4
# ...
Python API
import os
from bgg_search import BggClient, search_games, get_game
client = BggClient(token=os.environ["BGG_TOKEN"])
results = search_games("Catan", client)
for game in results:
print(game.id, game.name)
details = get_game(13, client)
print(details.name, details.bgg_rating)
Documentation
Development
See CONTRIBUTING.md.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bgg_search-0.5.0.tar.gz.
File metadata
- Download URL: bgg_search-0.5.0.tar.gz
- Upload date:
- Size: 33.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0d11d8f47cfb7cb62e21786cfbd783166e3759f39f69d087abd4562675b7eab6
|
|
| MD5 |
824258b1a3e01145ad2d3dd6d5d5dbe3
|
|
| BLAKE2b-256 |
5258e8cb4d46ad59c687eb30eba828af77077969749883d2606f6526f7088c80
|
Provenance
The following attestation bundles were made for bgg_search-0.5.0.tar.gz:
Publisher:
publish.yml on arnauldvm/bgg-search
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bgg_search-0.5.0.tar.gz -
Subject digest:
0d11d8f47cfb7cb62e21786cfbd783166e3759f39f69d087abd4562675b7eab6 - Sigstore transparency entry: 1769526420
- Sigstore integration time:
-
Permalink:
arnauldvm/bgg-search@c44b5a2e963ecb5f63d71e41b7a298747ebe28fc -
Branch / Tag:
refs/tags/version/0.5.0 - Owner: https://github.com/arnauldvm
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c44b5a2e963ecb5f63d71e41b7a298747ebe28fc -
Trigger Event:
push
-
Statement type:
File details
Details for the file bgg_search-0.5.0-py3-none-any.whl.
File metadata
- Download URL: bgg_search-0.5.0-py3-none-any.whl
- Upload date:
- Size: 8.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
906a62985d1cb276436a2a71c97d33d03d6d8a5c2ff0d668bfa3caabc2e12b2a
|
|
| MD5 |
dc10a928e431c9fcda02576122fd0ccd
|
|
| BLAKE2b-256 |
abe0c718c6514404eda6a2e8fa3604c0325681f8845cda4a6bfdcb08c655c0e1
|
Provenance
The following attestation bundles were made for bgg_search-0.5.0-py3-none-any.whl:
Publisher:
publish.yml on arnauldvm/bgg-search
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bgg_search-0.5.0-py3-none-any.whl -
Subject digest:
906a62985d1cb276436a2a71c97d33d03d6d8a5c2ff0d668bfa3caabc2e12b2a - Sigstore transparency entry: 1769527369
- Sigstore integration time:
-
Permalink:
arnauldvm/bgg-search@c44b5a2e963ecb5f63d71e41b7a298747ebe28fc -
Branch / Tag:
refs/tags/version/0.5.0 - Owner: https://github.com/arnauldvm
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c44b5a2e963ecb5f63d71e41b7a298747ebe28fc -
Trigger Event:
push
-
Statement type: