Skip to main content

🎲 bgg-pi

PyPI version Python Versions Tests Code Style: Ruff License Contributions Welcome

A modern, high-performance asynchronous Python client for BoardGameGeek.

bgg-pi is designed for developers who need reliable, non-blocking access to BoardGameGeek data. Whether you're building a Home Assistant integration, a discord bot, or a data analysis tool, bgg-pi makes it effortless.

✨ Features

  • 🚀 Fully Async: Built on top of aiohttp to keep your applications responsive.
  • ✍️ Record Plays: One of the few libraries that supports logging plays directly to a BGG account.
  • 📦 Collection Management: Fetch user collections with options to filter by ownership, wishlist status, and more.
  • 🎨 Rich Metadata: Retrieve high-fidelity game details including box art, ranks, weight, and play times.
  • 🛡️ Type Safe: Fully typed codebase for excellent IDE autocompletion and error checking.

🚀 Installation

Install via pip:

pip install bgg-pi

🛠️ Quick Start

Fetching User Plays

import asyncio
import aiohttp
from bgg_pi import BggClient

async def main():
    async with aiohttp.ClientSession() as session:
        client = BggClient(session, username="your_username")
        
        # specific api token is optional for public data but recommended
        plays = await client.fetch_plays()
        
        print(f"Found {plays['total']} plays!")
        # Access simple play data
        if plays['last_play']:
             print(f"Last played: {plays['last_play']['game']} on {plays['last_play']['date']}")

if __name__ == "__main__":
    asyncio.run(main())

Logging a Play

Authenticate securely and log your gaming sessions:

async def log_play():
    async with aiohttp.ClientSession() as session:
        # Password is required for play logging
        client = BggClient(session, username="seanmccabe", password="secret_password")
        
        if await client.login():
            success = await client.record_play(
                game_id=13,  # Catan
                date="2026-01-16",
                comments="Great game with friends!",
                length="90",
                players=[
                    {"name": "Sean", "win": True, "score": "10"},
                    {"name": "Friend", "win": False, "score": "8"}
                ]
            )
            
            if success:
                print("Play recorded successfully!")

📚 Documentation

The client covers the most essential BGG XML API2 and GeekPlay endpoints:

  • fetch_plays(): Get logged plays.
  • fetch_collection(): Get a user's board game collection (with filters).
  • fetch_thing_details([ids]): Get detailed metadata for specific games.
  • fetch_game_plays(id): Get play counts for a specific game.
  • record_play(...): Post a new play to BGG.

📦 Projects using bgg-pi

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

Metadata

Release files for bgg-pi 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bgg-pi 0.1.2
File Size Uploaded Provenance Actions
bgg_pi-0.1.2.tar.gz 11.6 kB With provenance Details for bgg_pi-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for bgg-pi 0.1.2
File Interpreter ABI Platform Actions
bgg_pi-0.1.2-py3-none-any.whl Python 3 none any Details for bgg_pi-0.1.2-py3-none-any.whl

Total release size: 20.0 kB

Release files / bgg_pi-0.1.2.tar.gz

Download URL bgg_pi-0.1.2.tar.gz
Size 11.6 kB
Tags Source
SHA-256 checksum
How to use checksums
664301c4a113fd92442d19759cdd040593e292d67db303ed497c8426725213be
BLAKE2b-256 checksum
How to use checksums
cbf0e4579d7583211c7aab2997f67efee42a5a0f69dc0e42baacf06ccadf737a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 7, 2026.

Transparency log

Release files / bgg_pi-0.1.2-py3-none-any.whl

Download URL bgg_pi-0.1.2-py3-none-any.whl
Size 8.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
272e6385bd4164477aa7c67770a05b0e5c68c2b5acbbd54619f4f131cb958c51
BLAKE2b-256 checksum
How to use checksums
c4601265a4d6021355523317cb6595af1d88916b4b12cc7346294e983669458a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 7, 2026.

Transparency log

Security for bgg-pi 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for bgg_pi-0.1.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 7, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page