From 4e8a8b50d3a7b82ba13942325ba5aa6bc40db569 Mon Sep 17 00:00:00 2001 From: Felix Blanke Date: Sun, 27 Aug 2023 00:16:54 +0200 Subject: [PATCH] Load Landesbezirk table --- wsgi.py | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/wsgi.py b/wsgi.py index 8555050..15308b0 100644 --- a/wsgi.py +++ b/wsgi.py @@ -9,12 +9,20 @@ app = Flask(__name__) @app.route("/") def tables( url: str = "https://beschaeftigtenbefragung.verdi.de/", - default_tag: str = "bez_data_2", ): - tag = request.args.get("tag") - if tag is None: - tag = default_tag - df = construct_dataframe(url=url, tag=tag, grouped=False) + df = construct_dataframe( + url=url, + tag="bez_data_0", + grouped=False, + special_tag="stud", + ) + + df_state = construct_dataframe( + url=url, + tag="bez_data_2", + grouped=False, + no_processing=True + ) output_str = [] @@ -47,9 +55,7 @@ def tables( output_str.append(tfoot) output_str.append(table[idx:]) - _print_as_html( - df.groupby("Bundesland", as_index=False)[["Digitale Befragung"]].sum() - ) + _print_as_html(df_state) _print_as_html(df) return render_template("base.html", tables="\n".join(output_str))