feat: Skript für Aktualisierung der Standfolien hinzugefügt
This commit is contained in:
parent
1f884a9dd0
commit
81904083fb
8 changed files with 131 additions and 13 deletions
1
scripts/.gitignore
vendored
Normal file
1
scripts/.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
venv
|
6
scripts/data.csv
Normal file
6
scripts/data.csv
Normal file
|
@ -0,0 +1,6 @@
|
|||
Kategorie,Bonn,Bund
|
||||
Ausgefüllte Gesprächsbögen,217,3078
|
||||
TVStud-Botschafter*innen,64,1208
|
||||
Streikbereit,139,2316
|
||||
Aktionsbereit,118,1760
|
||||
Gewerkschaftsmitglied,41,1093
|
|
15
scripts/requirements.txt
Normal file
15
scripts/requirements.txt
Normal file
|
@ -0,0 +1,15 @@
|
|||
beautifulsoup4==4.12.2
|
||||
certifi==2023.7.22
|
||||
charset-normalizer==3.2.0
|
||||
idna==3.4
|
||||
Jinja2==3.1.2
|
||||
MarkupSafe==2.1.3
|
||||
numpy==1.25.2
|
||||
pandas==2.1.0
|
||||
python-dateutil==2.8.2
|
||||
pytz==2023.3.post1
|
||||
requests==2.31.0
|
||||
six==1.16.0
|
||||
soupsieve==2.5
|
||||
tzdata==2023.3
|
||||
urllib3==2.0.4
|
69
scripts/stats.py
Normal file
69
scripts/stats.py
Normal file
|
@ -0,0 +1,69 @@
|
|||
from bs4 import BeautifulSoup
|
||||
import requests
|
||||
from jinja2 import Environment, FileSystemLoader, select_autoescape
|
||||
from datetime import date
|
||||
import pandas as pd
|
||||
import os
|
||||
|
||||
|
||||
env = Environment(loader=FileSystemLoader("templates"), autoescape=select_autoescape())
|
||||
|
||||
|
||||
def get_befragung():
|
||||
r = requests.get("https://tvstud-stats.fblanke.de/")
|
||||
soup = BeautifulSoup(r.text, "html.parser")
|
||||
|
||||
total = soup.find("table").find("tfoot").find_all("td")[1].text
|
||||
return total
|
||||
|
||||
|
||||
def generate_bundesweite_ziele_tex():
|
||||
template = env.get_template("bundesweite_ziele.tex")
|
||||
|
||||
return template.render(
|
||||
boegen="3078",
|
||||
eintritte="\\textasciitilde{}~200",
|
||||
botschafter="?",
|
||||
befragung=get_befragung(),
|
||||
datum=date.today().isoformat(),
|
||||
)
|
||||
|
||||
|
||||
def update_bundesweite_ziele_tex():
|
||||
with open("../slides/bundesweite_ziele.tex", "w") as f:
|
||||
f.write(generate_bundesweite_ziele_tex())
|
||||
|
||||
# Keep newline at the end of file, single newline will be stripped
|
||||
f.write("\n")
|
||||
f.write("\n")
|
||||
|
||||
|
||||
def generate_aktueller_stand_strukturaufbau():
|
||||
template = env.get_template("aktueller_stand_strukturaufbau.tex")
|
||||
|
||||
data_file = "data.csv"
|
||||
data = pd.read_csv(data_file)
|
||||
|
||||
return template.render(
|
||||
bonn=data["Bonn"],
|
||||
bund=data["Bund"],
|
||||
stand=date.fromtimestamp(os.path.getmtime(data_file)).isoformat(),
|
||||
)
|
||||
|
||||
|
||||
def update_aktueller_stand_strukturaufbau_tex():
|
||||
with open("../slides/aktueller_stand_strukturaufbau.tex", "w") as f:
|
||||
f.write(generate_aktueller_stand_strukturaufbau())
|
||||
|
||||
# Keep newline at the end of file, single newline will be stripped
|
||||
f.write("\n")
|
||||
f.write("\n")
|
||||
|
||||
|
||||
def main():
|
||||
update_bundesweite_ziele_tex()
|
||||
update_aktueller_stand_strukturaufbau_tex()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
17
scripts/templates/aktueller_stand_strukturaufbau.tex
Normal file
17
scripts/templates/aktueller_stand_strukturaufbau.tex
Normal file
|
@ -0,0 +1,17 @@
|
|||
\begin{frame}{Aktueller Stand Strukturaufbau}
|
||||
\renewcommand{\arraystretch}{1.5}
|
||||
\begin{tabularx}{\textwidth}{Xrrr}
|
||||
\textbf{Kategorie} & \textbf{Bonn} & \textbf{Bund} \\
|
||||
Ausgefüllte Gesprächsbögen & {{ bonn[0] }} & {{ bund[0] }} \\
|
||||
TVStud-Botschafter*innen & {{ bonn[1] }} & {{ bund[1] }} \\
|
||||
Streikbereit & {{ bonn[2] }} & {{ bund[2] }} \\
|
||||
Aktionsbereit & {{ bonn[3] }} & {{ bund[3] }} \\
|
||||
Gewerkschaftsmitglied \newline
|
||||
{\footnotesize ver.di oder GEW} & {{ bonn[4] }} & {{ bund[4] }}
|
||||
\end{tabularx}
|
||||
|
||||
\vspace{3em}
|
||||
{\small Stand: {{ stand }}}
|
||||
\end{frame}
|
||||
|
||||
\endinput
|
16
scripts/templates/bundesweite_ziele.tex
Normal file
16
scripts/templates/bundesweite_ziele.tex
Normal file
|
@ -0,0 +1,16 @@
|
|||
\begin{frame}{Bundesweite Ziele}
|
||||
|
||||
\renewcommand{\arraystretch}{1.5}
|
||||
\begin{tabularx}{\textwidth}{Xrrrr}
|
||||
\textbf{Kategorie} & \textbf{Erfolg} & \textbf{großer Erfolg} & \textbf{sehr großer Erfolg} & \textbf{Stand} \\
|
||||
Gesprächsbögen & 3100 & 3300 & 3500 & \emph{ {{- boegen -}} } \\
|
||||
ver.di-Neueintritte & 275 & - & - & \emph{ {{- eintritte -}} } \\
|
||||
Tarifbotschafter*innen & 100 & - & - & \emph{ {{- botschafter -}} } \\
|
||||
digitale Befragung & 1500 & 2500 & 3500 & \emph{ {{- befragung -}} }
|
||||
\end{tabularx}
|
||||
|
||||
\vspace{6em}
|
||||
{\small Stand:~{{- datum -}}}
|
||||
\end{frame}
|
||||
|
||||
\endinput
|
|
@ -1,12 +1,4 @@
|
|||
\begin{frame}{Aktueller Stand Strukturaufbau}
|
||||
% \textbf{Zusammenfassung (Stand: 2023-08-02):}
|
||||
% \begin{itemize}
|
||||
% \item 198 Ausgefüllte Gesprächsbögen (Bund: 3011)
|
||||
% \item 60 TVStud Botschafter*innen (1179)
|
||||
% \item 127 davon Streikbereit (2274)
|
||||
% \item 105 davon Aktionsbereit (1724)
|
||||
% \item 35 davon Gewerkschaftsmitglied (1081)
|
||||
% \end{itemize}
|
||||
\renewcommand{\arraystretch}{1.5}
|
||||
\begin{tabularx}{\textwidth}{Xrrr}
|
||||
\textbf{Kategorie} & \textbf{Bonn} & \textbf{Bund} \\
|
||||
|
@ -19,7 +11,8 @@
|
|||
\end{tabularx}
|
||||
|
||||
\vspace{3em}
|
||||
{\small Stand: 2023-08-28}
|
||||
{\small Stand: 2023-09-06}
|
||||
\end{frame}
|
||||
|
||||
\endinput
|
||||
|
||||
|
|
|
@ -4,13 +4,14 @@
|
|||
\begin{tabularx}{\textwidth}{Xrrrr}
|
||||
\textbf{Kategorie} & \textbf{Erfolg} & \textbf{großer Erfolg} & \textbf{sehr großer Erfolg} & \textbf{Stand} \\
|
||||
Gesprächsbögen & 3100 & 3300 & 3500 & \emph{3078} \\
|
||||
ver.di-Neueintritte & 275 & - & - & \emph{\textasciitilde{} 200} \\
|
||||
Tarifbotschafter*innen & 100 & - & - & ? \\
|
||||
digitale Befragung & 1500 & 2500 & 3500 & 541
|
||||
ver.di-Neueintritte & 275 & - & - & \emph{\textasciitilde{}~200} \\
|
||||
Tarifbotschafter*innen & 100 & - & - & \emph{?} \\
|
||||
digitale Befragung & 1500 & 2500 & 3500 & \emph{1574}
|
||||
\end{tabularx}
|
||||
|
||||
\vspace{6em}
|
||||
{\small Stand: 2023-08-15}
|
||||
{\small Stand:~2023-09-06}
|
||||
\end{frame}
|
||||
|
||||
\endinput
|
||||
|
||||
|
|
Loading…
Reference in a new issue