Skip to main content

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:

  1. --token-file PATH — CLI option pointing to a file containing the token.
  2. BGG_TOKEN — environment variable.
  3. .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

bgg_search-0.6.0.tar.gz (35.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bgg_search-0.6.0-py3-none-any.whl (8.4 kB view details)

Uploaded Python 3

File details

Details for the file bgg_search-0.6.0.tar.gz.

File metadata

  • Download URL: bgg_search-0.6.0.tar.gz
  • Upload date:
  • Size: 35.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for bgg_search-0.6.0.tar.gz
Algorithm Hash digest
SHA256 81cda566722c2aa427d030fc11e575f4ea41ac128c54bf9c89e1cab7de2e608a
MD5 4468bf30025525bb7ce0db251e5c31d9
BLAKE2b-256 43d6f215ceafa667ad21f200b5416f0007157b4ad4bcf158e11f8e384ed5030d

See more details on using hashes here.

Provenance

The following attestation bundles were made for bgg_search-0.6.0.tar.gz:

Publisher: publish.yml on arnauldvm/bgg-search

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file bgg_search-0.6.0-py3-none-any.whl.

File metadata

  • Download URL: bgg_search-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 8.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for bgg_search-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 86725ace5694bf8f439f8f1ea1a7e54c0f7b0fb135bd650279340bdc482f4cae
MD5 862d0871772c7c52b033968707d9bf54
BLAKE2b-256 8224beab000ada772daff87c932b6af0ba3034de99bcacd56aa6fadfa6eeaf0b

See more details on using hashes here.

Provenance

The following attestation bundles were made for bgg_search-0.6.0-py3-none-any.whl:

Publisher: publish.yml on arnauldvm/bgg-search

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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