add excluded games list. export to html table

This commit is contained in:
Maximilian Keßler 2023-11-09 13:40:18 +01:00
parent 9fe6971268
commit 52f8121865
Signed by: max
GPG key ID: BCC5A619923C0BA5

View file

@ -2,6 +2,7 @@ import requests
import requests_cache import requests_cache
import json import json
import csv import csv
import pandas
session = requests_cache.CachedSession('.hanab-live.cache') session = requests_cache.CachedSession('.hanab-live.cache')
@ -31,6 +32,8 @@ allowed_team_members = ['Carunty', 'HelanaAshryvr', 'rz']
allowed_players = [s.lower() for s in player_mapping.keys()] + [s.lower() for s in allowed_team_members] allowed_players = [s.lower() for s in player_mapping.keys()] + [s.lower() for s in allowed_team_members]
excluded_games = [1056958]
player_cols = set() player_cols = set()
for _, p in player_mapping.items(): for _, p in player_mapping.items():
player_cols.add(p) player_cols.add(p)
@ -67,6 +70,9 @@ def collect_player_games():
if len(players) not in [3,4,5]: if len(players) not in [3,4,5]:
continue continue
if game_id in excluded_games:
continue
ok = True ok = True
for player in players: for player in players:
if player.lower() not in allowed_players: if player.lower() not in allowed_players:
@ -121,5 +127,5 @@ if __name__ == "__main__":
num_others = row.get('Other', 0) num_others = row.get('Other', 0)
row['Other'] = num_others + 1 row['Other'] = num_others + 1
writer.writerow(row) writer.writerow(row)
a = pandas.read_csv("games.csv")
a.to_html("games.html")