From bdf63adb0d992e7c4ae91fc4c1430fd727018d07 Mon Sep 17 00:00:00 2001 From: Johannes Date: Mon, 2 Oct 2023 20:51:36 +0200 Subject: [PATCH] include stats about clothing size --- parse.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/parse.py b/parse.py index 867cc6d..70d061b 100644 --- a/parse.py +++ b/parse.py @@ -55,4 +55,16 @@ def wiki_stats(items: Dict[int, str], count_items: Dict[int, int], questions: Di for item_id, item_name in items.items(): ret += f"|| {item_name} || {count_items.get(item_id)}\n|-\n" ret += "|}\n" + + # ids of the questions which represent a size of a merch product + size_ids = (312, 313, 314, 316, 319, 320, 321, 322, 323) + ret += ('== Merch-Größenverteilung ==\n' + '{|class="wikitable sortable"\n' + '! Größe/Eigenschaft !! Wert !! Anzahl\n' + '|-\n') + for size_id in size_ids: + for size, count in quest_answers[size_id].items(): + ret += f"|| {questions[size_id]}: || {size[1]} || {count}\n|-\n" + ret += "|}\n" + return ret