Collects game stats from AWBW (Advance Wars By Web): https://awbw.amarriner.com/
The project uses uv for dependency management.
# Install runtime dependencies
uv sync
# (Optional) install notebook/tooling extras
uv sync --group devTo work inside a shell with the project environment activated:
uv run -- jupyter notebook # or any other commandfrom awbw_stats_aggregator import (
get_completed_games,
player_stats,
team_win_rates,
win_rate_matrix,
)
games = get_completed_games("ExampleUser", max_pages=1)
# Overall record for a player
overall = player_stats(games, "ExampleUser")
# Head-to-head against specific rivals
head_to_head = player_stats(
games,
"ExampleUser",
opponents=["Rival123", "AnotherOpponent"],
)
# Symmetric win-rate matrix for multiple players
players = ["ExampleUser", "Rival123", "AnotherOpponent"]
matrix = win_rate_matrix(games, players)
# Team-vs-team win rates (e.g., 2v2 matchups)
team_pairs = team_win_rates(games, players, team_size=2)
print(overall)
print(head_to_head)
print(matrix)
print(team_pairs)