A production-grade Python library for extracting, transforming, and persisting data from the BoardGameGeek XML API2.
📚 User Guide - Installation, configuration, and usage
📖 API Reference - Complete API documentation
💡 Examples - Real-world usage examples
pip install -e .
# or with uv
uv add .
Set your BGG API token (required):
# Create a .env file
echo "BGG_API_TOKEN=your_token_here" > .env
# Search for a game
bgg-extractor search --query "Wingspan" --output results.json
# Get game details
bgg-extractor things --ids 174430 13 --stats --output games.json
# Get user collection
bgg-extractor collection --username eekspider --stats --output collection.csv
from bgg_extractor import search, get_things, save_json
# Search for a game
results = search("Catan")
print(f"Found {len(results.items)} items")
# Get game details
game_ids = [item.id for item in results.items[:5]]
games = get_things(game_ids, stats=True)
# Save to file
save_json(games.items, "catan_games.json")
pytestruff check srcmypy srcSee CONTRIBUTING.md