Bugnet SDK for Pygame — bug reporting, crash analytics, and session replay for Python games
Project description
Bugnet SDK for Pygame
A lightweight bug reporting and crash analytics SDK for Pygame games. Enables manual bug reports, automatic crash capture, screenshot capture, session replay, and performance profiling.
Installation
pip install bugnet-sdk
For memory usage reporting, install with the optional psutil dependency:
pip install bugnet-sdk[memory]
Quick Start
import pygame
import bugnet_sdk
pygame.init()
screen = pygame.display.set_mode((800, 600))
# Initialize the SDK with your API key
bugnet_sdk.init("sk_live_YOUR_KEY", "https://api.bugnet.io")
clock = pygame.time.Clock()
running = True
while running:
dt = clock.tick(60)
for event in pygame.event.get():
if event.type == pygame.QUIT:
running = False
if event.type == pygame.KEYDOWN and event.key == pygame.K_F1:
bugnet_sdk.show_widget()
bugnet_sdk.handle_event(event)
bugnet_sdk.update(screen, clock)
# ... your rendering ...
pygame.display.flip()
bugnet_sdk.shutdown()
Features
- Automatic crash capture — Unhandled exceptions are reported with full stack traces
- In-game widget — Players can file bug reports without leaving the game
- Screenshot capture — Automatic screenshots attached to error reports
- Session replay — Records mouse and keyboard input for replay
- Performance profiling — FPS, frame time, and memory usage snapshots
- Freeze detection — Auto-reports when a frame exceeds 2 seconds
- Scene load tracking — Track load times for levels and scenes
- Log capture — Recent stdout output attached to bug reports
API Reference
| Function | Description |
|---|---|
init(api_key, server_url, auto_capture, game_version) |
Initialize the SDK |
report_bug(title, description, ...) |
Submit a manual bug report |
report_error(message, stack) |
Report an error/exception |
handle_event(event) |
Pass pygame events for replay and widget |
update(screen, clock) |
Call per-frame for metrics and widget |
show_widget() / hide_widget() |
Toggle the in-game report overlay |
set_player(steam_id, player_name) |
Set player identity |
scene_load_start(name) / scene_load_end(name) |
Track scene load times |
shutdown() |
Clean up before quitting |
Documentation
Full documentation: https://bugnet.io/docs
Pygame SDK page: https://bugnet.io/for/pygame/
License
MIT
Project details
Release history Release notifications | RSS feed
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 bugnet_sdk-1.0.0.tar.gz.
File metadata
- Download URL: bugnet_sdk-1.0.0.tar.gz
- Upload date:
- Size: 14.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
64ee2b5da891d1886b7dab3025d0adefaa10e892c088d9687367d9c3579976a1
|
|
| MD5 |
a5179ea5009b68dbca09f2b8e2fa39ac
|
|
| BLAKE2b-256 |
3317673f712bd33d5145446027c4bc834dd4508404e0d299faab4e52107bd333
|
File details
Details for the file bugnet_sdk-1.0.0-py3-none-any.whl.
File metadata
- Download URL: bugnet_sdk-1.0.0-py3-none-any.whl
- Upload date:
- Size: 14.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dd8ce0d707f9b1d95181041fcd2a7c29bb6a31203b82496a3cf7553834c05b5d
|
|
| MD5 |
5eae22a4d342b69fe14d8692ba761d36
|
|
| BLAKE2b-256 |
9bda6080707ea609388d0206b4f2a66a326acca893d3e375ea2e38b3847d52ec
|