22 Commits

Author SHA1 Message Date
79c3cb83c7 trivy_image_scan 2025-12-13 22:56:43 +01:00
cb9fa61bc5 trivy_image_scan 2025-12-13 22:51:46 +01:00
9a1e438615 trivy_image_scan 2025-12-13 22:51:20 +01:00
787cb10e21 - pump streamlit to v1.52.1
- pump numpy to v2.3.5
- run container with
2025-12-09 23:23:39 +01:00
ad208f3403 fix compose-example in readme.md 2025-11-23 18:18:02 +01:00
b60316750a adding image-release on docker hub to ci-pipeline 2025-11-23 17:55:50 +01:00
013a6b298e Merge pull request 'pump to' (#4) from update_dependencies into main
Reviewed-on: #4
2025-11-16 11:55:27 +01:00
f1dce2417f pump to
streamlit==1.51.0
streamlit-folium==0.25.3
pandas==2.3.3
matplotlib~=3.10.7
numpy~=2.3.4
and automatic pip-upgrade while build container
2025-11-16 11:51:11 +01:00
9947c205c7 update versions of requirements 2025-09-28 16:43:33 +02:00
8510169495 erweiterung zeichenzählen 2025-08-30 13:37:00 +02:00
c88e673759 fix output for remorse_en and t9_en 2025-08-24 20:54:28 +02:00
f4efc17e2a Merge pull request 'create_special_wbs_at_startup' (#3) from create_special_wbs_at_startup into main
Reviewed-on: #3
2025-08-24 19:41:30 +02:00
03b2e4a0ee generate special wb at startup 2025-08-24 19:40:38 +02:00
77fd1be257 generate special wb at startup 2025-08-24 19:29:58 +02:00
64dc76327e Merge pull request 'rework of patch for streamlit to display my favicon and title when paste url in messengers with preload-function' (#2) from better_streamlit_patch into main
Reviewed-on: #2
2025-08-24 14:28:10 +02:00
3f4aed3978 rework of patch for streamlit to display my favicon and title when paste url in messengers with preload-function 2025-08-24 14:27:02 +02:00
6939c01883 fix requirements.txt 2025-08-23 16:32:34 +02:00
2a380c5066 fix requirements.txt 2025-08-23 16:31:38 +02:00
823dce7f8f fix requirements.txt 2025-08-23 16:10:39 +02:00
fecce2fd8c update to new streamlit-version and using st_folium for map-display 2025-08-23 15:13:53 +02:00
2be61aac72 Merge pull request 'adding RLOU/RLUD -> Graph' (#1) from pfadzeichner into main
Reviewed-on: #1
2025-08-19 23:56:38 +02:00
8987e95775 adding RLOU/RLUD -> Graph 2025-08-19 23:55:07 +02:00
12 changed files with 237 additions and 355 deletions

View File

@@ -6,11 +6,11 @@ on:
image_tag: image_tag:
description: '2. Tag für das Docker-Image (außer latest) (z.B. v1.0.0)' description: '2. Tag für das Docker-Image (außer latest) (z.B. v1.0.0)'
required: true required: true
default: '0.4.0' default: '0.7.3'
env: env:
image_name: mysteryhelfer image_name: mysteryhelfer
registry: gitea.tebarius.duckdns.org registry_gitea: gitea.tebarius.duckdns.org
user: tebarius user: tebarius
jobs: jobs:
@@ -26,9 +26,15 @@ jobs:
- name: Login to Gitea - name: Login to Gitea
uses: docker/login-action@v2 uses: docker/login-action@v2
with: with:
registry: ${{ env.registry }} registry: ${{ env.registry_gitea }}
username: ${{ env.user }} username: ${{ env.user }}
password: ${{ secrets.DOCKER_PULL_TOKEN }} password: ${{ secrets.IMAGE_REGISTRY_TOKEN_GITEA }}
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ env.user }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- name: Build and push - name: Build and push
run: | run: |
@@ -39,6 +45,8 @@ jobs:
docker buildx build \ docker buildx build \
--file ./Dockerfile \ --file ./Dockerfile \
--platform linux/amd64,linux/arm64 \ --platform linux/amd64,linux/arm64 \
--tag ${{ env.registry }}/${{ env.user }}/${{ env.image_name }}:latest \ --tag ${{ env.registry_gitea }}/${{ env.user }}/${{ env.image_name }}:latest \
--tag ${{ env.registry }}/${{ env.user }}/${{ env.image_name }}:${{ github.event.inputs.image_tag }} \ --tag ${{ env.registry_gitea }}/${{ env.user }}/${{ env.image_name }}:${{ github.event.inputs.image_tag }} \
--tag ${{ env.user }}/${{ env.image_name }}:latest \
--tag ${{ env.user }}/${{ env.image_name }}:${{ github.event.inputs.image_tag }} \
--push ./ --push ./

View File

@@ -0,0 +1,28 @@
name: release-tag
on:
workflow_dispatch: # Manuelles Auslösen des Workflows
inputs:
image_tag:
description: 'Tag für das zu scannende Docker-Image z.B. latest'
required: true
default: 'latest'
env:
image_name: mysteryhelfer
registry_gitea: gitea.tebarius.duckdns.org
user: tebarius
jobs:
trivy_image_scan:
runs-on: ubuntu-latest
container: aquasec/trivy:latest
steps:
- name: Scan image with trivy
run: |
trivy image \
--exit-code 1 \
--scanners vuln,misconfig,secret \
--severity MEDIUM,HIGH,CRITICAL \
--ignore-unfixed \
${{ env.registry_gitea }}/${{ env.user }}/${{ env.image_name }}:${{ github.event.inputs.image_tag }}

View File

@@ -5,17 +5,27 @@ LABEL description="tebarius Mysteryhelfer web"
WORKDIR /app WORKDIR /app
RUN apt-get update \ RUN apt-get update \
&& apt-get install -y curl \ && apt-get install -y --no-install-recommends curl \
&& apt-get clean \ && apt-get clean \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
COPY requirements.txt . COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY ./app /app COPY ./app /app
COPY ./patch-streamlit/* /usr/local/lib/python3.13/site-packages/streamlit/static/ RUN python -m pip install --upgrade pip \
&& pip install --no-cache-dir -r requirements.txt
# ein bisschen Patchen um auch beim Bookmarken oder Versenden der Webadresse per Messenger den richtigen Titel und das
# richtige Favicon zu verwenden/sehen
COPY ./app/images/favicon.ico /usr/local/lib/python3.13/site-packages/streamlit/static/favicon.ico
RUN sed -i -e 's|favicon\.png|favicon.ico|' \
-e 's|<title>.*</title>|<title>tebarius Mysteryhelfer (web)</title>|' \
/usr/local/lib/python3.13/site-packages/streamlit/static/index.html \
&& useradd -m -u 1000 myst \
&& chown -R myst:myst /app
USER myst
EXPOSE 8501 EXPOSE 8501

View File

@@ -3,6 +3,8 @@
import streamlit as st import streamlit as st
import base64 import base64
import tools import tools
import matplotlib.pyplot as plt
import helper
standard_output = ('#### Um den HILFE-Text zu einzelnen Funktionen aufzurufen bitte die Funktion mit leerem' standard_output = ('#### Um den HILFE-Text zu einzelnen Funktionen aufzurufen bitte die Funktion mit leerem'
' Eingabefeld aufrufen.') ' Eingabefeld aufrufen.')
@@ -44,192 +46,132 @@ with title_col:
def auswahl_verarbeiten(): def auswahl_verarbeiten():
text = st.session_state.input_text text = st.session_state.input_text
auswahl = st.session_state.option auswahl = st.session_state.option
st.session_state.map_data = None
st.session_state.graph_data = None
if auswahl == "Wähle eine Funktion": if auswahl == "Wähle eine Funktion":
st.session_state.output_text = standard_output st.session_state.output_text = standard_output
st.session_state.map_data = None
elif "Cesarchiffre (all)" in auswahl: elif "Cesarchiffre (all)" in auswahl:
st.session_state.output_text = tools.cesar_all(text) st.session_state.output_text = tools.cesar_all(text)
st.session_state.map_data = None
elif "BW,BWW,... ermitteln" in auswahl: elif "BW,BWW,... ermitteln" in auswahl:
st.session_state.output_text = tools.buchstabenwortwert(text) st.session_state.output_text = tools.buchstabenwortwert(text)
st.session_state.map_data = None
elif "Buchstabenwert -> Text" in auswahl: elif "Buchstabenwert -> Text" in auswahl:
st.session_state.output_text = tools.buchstabenwert_zu_text(text) st.session_state.output_text = tools.buchstabenwert_zu_text(text)
st.session_state.map_data = None
elif "Zeichenzählen" in auswahl: elif "Zeichenzählen" in auswahl:
st.session_state.output_text = tools.zeichenanzahl(text) st.session_state.output_text = tools.zeichenanzahl(text)
st.session_state.map_data = None
elif "Text rückwärts" in auswahl: elif "Text rückwärts" in auswahl:
st.session_state.output_text = tools.zeichenkette_reverse(text) st.session_state.output_text = tools.zeichenkette_reverse(text)
st.session_state.map_data = None
elif "Quersumme(n)" in auswahl: elif "Quersumme(n)" in auswahl:
st.session_state.output_text = tools.quersummen(text) st.session_state.output_text = tools.quersummen(text)
st.session_state.map_data = None
elif "Einschlüsse zählen" in auswahl: elif "Einschlüsse zählen" in auswahl:
st.session_state.output_text = tools.einschluss_count(text) st.session_state.output_text = tools.einschluss_count(text)
st.session_state.map_data = None
elif "ABC -> Morse" in auswahl: elif "ABC -> Morse" in auswahl:
st.session_state.output_text = tools.abc_to_morse(text) st.session_state.output_text = tools.abc_to_morse(text)
st.session_state.map_data = None
elif "Morse -> ABC" in auswahl: elif "Morse -> ABC" in auswahl:
st.session_state.output_text = tools.morse_to_abc(text) st.session_state.output_text = tools.morse_to_abc(text)
st.session_state.map_data = None
elif "ROT5" in auswahl: elif "ROT5" in auswahl:
st.session_state.output_text = tools.rot5(text) st.session_state.output_text = tools.rot5(text)
st.session_state.map_data = None
elif "ROT13" in auswahl: elif "ROT13" in auswahl:
st.session_state.output_text = tools.rot13(text) st.session_state.output_text = tools.rot13(text)
st.session_state.map_data = None
elif "ROT18" in auswahl: elif "ROT18" in auswahl:
st.session_state.output_text = tools.rot18(text) st.session_state.output_text = tools.rot18(text)
st.session_state.map_data = None
elif "ROT47" in auswahl: elif "ROT47" in auswahl:
st.session_state.output_text = tools.rot47(text) st.session_state.output_text = tools.rot47(text)
st.session_state.map_data = None
elif "ASCII-Text -> HEX" in auswahl: elif "ASCII-Text -> HEX" in auswahl:
st.session_state.output_text = tools.ascii_to_hex(text) st.session_state.output_text = tools.ascii_to_hex(text)
st.session_state.map_data = None
elif "ASCII-Text -> DEZ" in auswahl: elif "ASCII-Text -> DEZ" in auswahl:
st.session_state.output_text = tools.ascii_to_dez(text) st.session_state.output_text = tools.ascii_to_dez(text)
st.session_state.map_data = None
elif "ASCII-Text -> Octal" in auswahl: elif "ASCII-Text -> Octal" in auswahl:
st.session_state.output_text = tools.ascii_to_octal(text) st.session_state.output_text = tools.ascii_to_octal(text)
st.session_state.map_data = None
elif "ASCII-Text -> BIN (16bit)" in auswahl: elif "ASCII-Text -> BIN (16bit)" in auswahl:
st.session_state.output_text = tools.ascii_to_bin16(text) st.session_state.output_text = tools.ascii_to_bin16(text)
st.session_state.map_data = None
elif "ASCII-Text -> BIN (8bit)" in auswahl: elif "ASCII-Text -> BIN (8bit)" in auswahl:
st.session_state.output_text = tools.ascii_to_bin8(text) st.session_state.output_text = tools.ascii_to_bin8(text)
st.session_state.map_data = None
elif "HEX -> ASCII-Text" in auswahl: elif "HEX -> ASCII-Text" in auswahl:
st.session_state.output_text = tools.hex_to_ascii(text) st.session_state.output_text = tools.hex_to_ascii(text)
st.session_state.map_data = None
elif "DEZ -> ASCII-Text" in auswahl: elif "DEZ -> ASCII-Text" in auswahl:
st.session_state.output_text = tools.dez_to_ascii(text) st.session_state.output_text = tools.dez_to_ascii(text)
st.session_state.map_data = None
elif "Octal -> ASCII-Text" in auswahl: elif "Octal -> ASCII-Text" in auswahl:
st.session_state.output_text = tools.octal_to_ascii(text) st.session_state.output_text = tools.octal_to_ascii(text)
st.session_state.map_data = None
elif "BIN -> ASCII-Text" in auswahl: elif "BIN -> ASCII-Text" in auswahl:
st.session_state.output_text = tools.bin_to_ascii(text) st.session_state.output_text = tools.bin_to_ascii(text)
st.session_state.map_data = None
elif "Zahlwortsuche-DE (0-12)" in auswahl: elif "Zahlwortsuche-DE (0-12)" in auswahl:
st.session_state.output_text = tools.zahlwortsuche_de(text) st.session_state.output_text = tools.zahlwortsuche_de(text)
st.session_state.map_data = None
elif "Zahlwortsuche-EN (0-15)" in auswahl: elif "Zahlwortsuche-EN (0-15)" in auswahl:
st.session_state.output_text = tools.zahlwortsuche_en(text) st.session_state.output_text = tools.zahlwortsuche_en(text)
st.session_state.map_data = None
elif "KENNYspeak kodieren" in auswahl: elif "KENNYspeak kodieren" in auswahl:
st.session_state.output_text = tools.kenny_kodieren(text) st.session_state.output_text = tools.kenny_kodieren(text)
st.session_state.map_data = None
elif "KENNYspeak dekodieren" in auswahl: elif "KENNYspeak dekodieren" in auswahl:
st.session_state.output_text = tools.kenny_dekodieren(text) st.session_state.output_text = tools.kenny_dekodieren(text)
st.session_state.map_data = None
elif "KENNYspeak raten" in auswahl: elif "KENNYspeak raten" in auswahl:
st.session_state.output_text = tools.kenny_raten(text) st.session_state.output_text = tools.kenny_raten(text)
st.session_state.map_data = None
elif "Primz.Alpha dekodieren" in auswahl: elif "Primz.Alpha dekodieren" in auswahl:
st.session_state.output_text = tools.primzahlalphabet_dekodieren(text) st.session_state.output_text = tools.primzahlalphabet_dekodieren(text)
st.session_state.map_data = None
elif "ist (n.te) Primzahl?" in auswahl: elif "ist (n.te) Primzahl?" in auswahl:
st.session_state.output_text = tools.primzahlpruefen(text) st.session_state.output_text = tools.primzahlpruefen(text)
st.session_state.map_data = None
elif "zeige n.te Primzahl" in auswahl: elif "zeige n.te Primzahl" in auswahl:
st.session_state.output_text = tools.nte_primzahl(text) st.session_state.output_text = tools.nte_primzahl(text)
st.session_state.map_data = None
elif "Primfaktorenzerlegung" in auswahl: elif "Primfaktorenzerlegung" in auswahl:
st.session_state.output_text = tools.primfaktoren(text) st.session_state.output_text = tools.primfaktoren(text)
st.session_state.map_data = None
elif "HEX -> DEZ,OCT,BIN" in auswahl: elif "HEX -> DEZ,OCT,BIN" in auswahl:
st.session_state.output_text = tools.hex_to_dez_oct_bin(text) st.session_state.output_text = tools.hex_to_dez_oct_bin(text)
st.session_state.map_data = None
elif "DEZ -> HEX,OCT,BIN" in auswahl: elif "DEZ -> HEX,OCT,BIN" in auswahl:
st.session_state.output_text = tools.dez_to_hex_oct_bin(text) st.session_state.output_text = tools.dez_to_hex_oct_bin(text)
st.session_state.map_data = None
elif "OCT -> HEX,DEZ,BIN" in auswahl: elif "OCT -> HEX,DEZ,BIN" in auswahl:
st.session_state.output_text = tools.oct_to_hex_dez_bin(text) st.session_state.output_text = tools.oct_to_hex_dez_bin(text)
st.session_state.map_data = None
elif "BIN -> HEX,DEZ,OCT" in auswahl: elif "BIN -> HEX,DEZ,OCT" in auswahl:
st.session_state.output_text = tools.bin_to_hex_dez_oct(text) st.session_state.output_text = tools.bin_to_hex_dez_oct(text)
st.session_state.map_data = None
elif "Text -> Tomtom" in auswahl: elif "Text -> Tomtom" in auswahl:
st.session_state.output_text = tools.abc_to_tomtom(text) st.session_state.output_text = tools.abc_to_tomtom(text)
st.session_state.map_data = None
elif "Tomtom -> Text" in auswahl: elif "Tomtom -> Text" in auswahl:
st.session_state.output_text = tools.tomtom_to_abc(text) st.session_state.output_text = tools.tomtom_to_abc(text)
st.session_state.map_data = None
elif "Text -> Slash and Pipe" in auswahl: elif "Text -> Slash and Pipe" in auswahl:
st.session_state.output_text = tools.text_to_slashpipe(text) st.session_state.output_text = tools.text_to_slashpipe(text)
st.session_state.map_data = None
elif "Slash and Pipe -> Text" in auswahl: elif "Slash and Pipe -> Text" in auswahl:
st.session_state.output_text = tools.slashpipe_to_text(text) st.session_state.output_text = tools.slashpipe_to_text(text)
st.session_state.map_data = None
elif "PSE: O.zahl <-> Symbol" in auswahl: elif "PSE: O.zahl <-> Symbol" in auswahl:
st.session_state.output_text = tools.periodensystem(text) st.session_state.output_text = tools.periodensystem(text)
st.session_state.map_data = None
elif "Nak-Nak -> Text" in auswahl: elif "Nak-Nak -> Text" in auswahl:
st.session_state.output_text = tools.naknak_to_text(text) st.session_state.output_text = tools.naknak_to_text(text)
st.session_state.map_data = None
elif "Navajo -> Text" in auswahl: elif "Navajo -> Text" in auswahl:
st.session_state.output_text = tools.navajo_to_text(text) st.session_state.output_text = tools.navajo_to_text(text)
st.session_state.map_data = None
elif "Kreiszahl PI" in auswahl: elif "Kreiszahl PI" in auswahl:
st.session_state.output_text = tools.pi_suche(text) st.session_state.output_text = tools.pi_suche(text)
st.session_state.map_data = None
elif "Eulersche Zahl" in auswahl: elif "Eulersche Zahl" in auswahl:
st.session_state.output_text = tools.euler_suche(text) st.session_state.output_text = tools.euler_suche(text)
st.session_state.map_data = None
elif "phi (goldener Schnitt)" in auswahl: elif "phi (goldener Schnitt)" in auswahl:
st.session_state.output_text = tools.goldener_schnitt_suche(text) st.session_state.output_text = tools.goldener_schnitt_suche(text)
st.session_state.map_data = None
elif "Anagrammsuche-DE" in auswahl: elif "Anagrammsuche-DE" in auswahl:
st.session_state.output_text = tools.anagramm_suche_de(text) st.session_state.output_text = tools.anagramm_suche_de(text)
st.session_state.map_data = None
elif "Anagrammsuche-EN" in auswahl: elif "Anagrammsuche-EN" in auswahl:
st.session_state.output_text = tools.anagramm_suche_en(text) st.session_state.output_text = tools.anagramm_suche_en(text)
st.session_state.map_data = None
elif "Wortsuche-DE" in auswahl: elif "Wortsuche-DE" in auswahl:
st.session_state.output_text = tools.wortsuche_de(text) st.session_state.output_text = tools.wortsuche_de(text)
st.session_state.map_data = None
elif "Wortsuche-EN" in auswahl: elif "Wortsuche-EN" in auswahl:
st.session_state.output_text = tools.wortsuche_en(text) st.session_state.output_text = tools.wortsuche_en(text)
st.session_state.map_data = None
elif "Re-Morse-DE" in auswahl: elif "Re-Morse-DE" in auswahl:
st.session_state.output_text = tools.remorse_de(text) st.session_state.output_text = tools.remorse_de(text)
st.session_state.map_data = None
elif "Re-Morse-EN" in auswahl: elif "Re-Morse-EN" in auswahl:
st.session_state.output_text = tools.remorse_en(text) st.session_state.output_text = tools.remorse_en(text)
st.session_state.map_data = None
elif "T9-DE dekodieren" in auswahl: elif "T9-DE dekodieren" in auswahl:
st.session_state.output_text = tools.t9_de(text) st.session_state.output_text = tools.t9_de(text)
st.session_state.map_data = None
elif "T9-EN dekodieren" in auswahl: elif "T9-EN dekodieren" in auswahl:
st.session_state.output_text = tools.t9_en(text) st.session_state.output_text = tools.t9_en(text)
st.session_state.map_data = None
elif "Vigenere-Chiffre" in auswahl: elif "Vigenere-Chiffre" in auswahl:
st.session_state.output_text = tools.vigenere(text, additional_parameter) st.session_state.output_text = tools.vigenere(text, additional_parameter)
st.session_state.map_data = None
elif "Wolseley-Chiffre" in auswahl: elif "Wolseley-Chiffre" in auswahl:
st.session_state.output_text = tools.wolseley(text, additional_parameter) st.session_state.output_text = tools.wolseley(text, additional_parameter)
st.session_state.map_data = None
elif "Mono.-Substitution" in auswahl: elif "Mono.-Substitution" in auswahl:
st.session_state.output_text = tools.monoalphasubstitution(text, additional_parameter) st.session_state.output_text = tools.monoalphasubstitution(text, additional_parameter)
st.session_state.map_data = None
elif "Autokey-Chiffre" in auswahl: elif "Autokey-Chiffre" in auswahl:
st.session_state.output_text = tools.autokey(text, additional_parameter) st.session_state.output_text = tools.autokey(text, additional_parameter)
st.session_state.map_data = None
elif "Polybios kodieren" in auswahl: elif "Polybios kodieren" in auswahl:
st.session_state.output_text = tools.polybios_encode(text, additional_parameter) st.session_state.output_text = tools.polybios_encode(text, additional_parameter)
st.session_state.map_data = None
elif "Polybios dekodieren" in auswahl: elif "Polybios dekodieren" in auswahl:
st.session_state.output_text = tools.polybios_decode(text, additional_parameter) st.session_state.output_text = tools.polybios_decode(text, additional_parameter)
st.session_state.map_data = None
elif "Klopfcode kodieren" in auswahl: elif "Klopfcode kodieren" in auswahl:
st.session_state.output_text = tools.klopfcode_encode(text) st.session_state.output_text = tools.klopfcode_encode(text)
st.session_state.map_data = None
elif "Klopfcode dekodieren" in auswahl: elif "Klopfcode dekodieren" in auswahl:
st.session_state.output_text = tools.klopfcode_decode(text) st.session_state.output_text = tools.klopfcode_decode(text)
st.session_state.map_data = None
elif "Maptiles/Kachelkoord." in auswahl: elif "Maptiles/Kachelkoord." in auswahl:
output, mapd = tools.maptiles_kachelkoordinaten(text) output, mapd = tools.maptiles_kachelkoordinaten(text)
st.session_state.output_text = output st.session_state.output_text = output
@@ -240,50 +182,40 @@ def auswahl_verarbeiten():
st.session_state.map_data = mapd st.session_state.map_data = mapd
elif "Chronogramm" in auswahl: elif "Chronogramm" in auswahl:
st.session_state.output_text = tools.chronogramm(text) st.session_state.output_text = tools.chronogramm(text)
st.session_state.map_data = None
elif "Zahl röm. <-> arabisch" in auswahl: elif "Zahl röm. <-> arabisch" in auswahl:
st.session_state.output_text = tools.zahlen_roemisch_arabisch_umwandeln(text) st.session_state.output_text = tools.zahlen_roemisch_arabisch_umwandeln(text)
st.session_state.map_data = None
elif "URL decode" in auswahl: elif "URL decode" in auswahl:
st.session_state.output_text = tools.url_decode(text) st.session_state.output_text = tools.url_decode(text)
st.session_state.map_data = None
elif "Reverse-Wherigo" in auswahl: elif "Reverse-Wherigo" in auswahl:
output, mapd = tools.reversewig(text) output, mapd = tools.reversewig(text)
st.session_state.output_text = output st.session_state.output_text = output
st.session_state.map_data = mapd st.session_state.map_data = mapd
elif "Base64 <-> ASCII" in auswahl: elif "Base64 <-> ASCII" in auswahl:
st.session_state.output_text = tools.base64_ascii(text) st.session_state.output_text = tools.base64_ascii(text)
st.session_state.map_data = None
elif "Jägerzaun kodieren" in auswahl: elif "Jägerzaun kodieren" in auswahl:
st.session_state.output_text = tools.jaegerzaun_encrypt(text, additional_parameter) st.session_state.output_text = tools.jaegerzaun_encrypt(text, additional_parameter)
st.session_state.map_data = None
elif "Jägerzaun dekodieren" in auswahl: elif "Jägerzaun dekodieren" in auswahl:
st.session_state.output_text = tools.jaegerzaun_decrypt(text, additional_parameter) st.session_state.output_text = tools.jaegerzaun_decrypt(text, additional_parameter)
st.session_state.map_data = None
elif "ADFGX kodieren" in auswahl: elif "ADFGX kodieren" in auswahl:
st.session_state.output_text = tools.adfgx_kodieren(text, additional_parameter) st.session_state.output_text = tools.adfgx_kodieren(text, additional_parameter)
st.session_state.map_data = None
elif "ADFGX dekodieren" in auswahl: elif "ADFGX dekodieren" in auswahl:
st.session_state.output_text = tools.adfgx_dekodieren(text, additional_parameter) st.session_state.output_text = tools.adfgx_dekodieren(text, additional_parameter)
st.session_state.map_data = None
elif "ADFGVX kodieren" in auswahl: elif "ADFGVX kodieren" in auswahl:
st.session_state.output_text = tools.adfgvx_kodieren(text, additional_parameter) st.session_state.output_text = tools.adfgvx_kodieren(text, additional_parameter)
st.session_state.map_data = None
elif "ADFGVX dekodieren" in auswahl: elif "ADFGVX dekodieren" in auswahl:
st.session_state.output_text = tools.adfgvx_dekodieren(text, additional_parameter) st.session_state.output_text = tools.adfgvx_dekodieren(text, additional_parameter)
st.session_state.map_data = None
elif "Brainfuck -> Text" in auswahl: elif "Brainfuck -> Text" in auswahl:
st.session_state.output_text = tools.brainfuck_to_text(text) st.session_state.output_text = tools.brainfuck_to_text(text)
st.session_state.map_data = None
elif "Text -> Brainfuck" in auswahl: elif "Text -> Brainfuck" in auswahl:
st.session_state.output_text = tools.text_to_brainfuck(text) st.session_state.output_text = tools.text_to_brainfuck(text)
st.session_state.map_data = None
elif "Ook -> Text" in auswahl: elif "Ook -> Text" in auswahl:
st.session_state.output_text = tools.ook_to_text(text) st.session_state.output_text = tools.ook_to_text(text)
st.session_state.map_data = None
elif "Text -> Ook" in auswahl: elif "Text -> Ook" in auswahl:
st.session_state.output_text = tools.text_to_ook(text) st.session_state.output_text = tools.text_to_ook(text)
st.session_state.map_data = None elif "RLOU/RLUD -> Graph" in auswahl:
output, graph_data = tools.rlou_to_graph(text)
st.session_state.output_text = output
st.session_state.graph_data = graph_data
# Standardwerte im Session State initialisieren # Standardwerte im Session State initialisieren
if 'option' not in st.session_state: if 'option' not in st.session_state:
@@ -292,8 +224,11 @@ if 'input_text' not in st.session_state:
st.session_state.input_text = "" st.session_state.input_text = ""
if 'output_text' not in st.session_state: if 'output_text' not in st.session_state:
st.session_state.output_text = standard_output st.session_state.output_text = standard_output
st.session_state.output_text += helper.generate_special_files()
if 'map_data' not in st.session_state: if 'map_data' not in st.session_state:
st.session_state.map_data = None st.session_state.map_data = None
if 'graph_data' not in st.session_state:
st.session_state.graph_data = None
# Eingabefeld im Hauptbereich # Eingabefeld im Hauptbereich
input_text = st.text_area('Gib deinen Text hier ein und wähle eine Funktion im Menü auf der linken Seite:', input_text = st.text_area('Gib deinen Text hier ein und wähle eine Funktion im Menü auf der linken Seite:',
@@ -385,6 +320,7 @@ option = st.sidebar.radio("hidden_label",
":green-badge[Text -> Brainfuck]", ":green-badge[Text -> Brainfuck]",
":green-badge[Ook -> Text]", ":green-badge[Ook -> Text]",
":green-badge[Text -> Ook]", ":green-badge[Text -> Ook]",
":red[RLOU/RLUD -> Graph]"
), ),
key='option', key='option',
on_change=auswahl_verarbeiten, on_change=auswahl_verarbeiten,
@@ -426,4 +362,14 @@ st.markdown(st.session_state.output_text)
# Karte anzeigen, falls aktiviert # Karte anzeigen, falls aktiviert
if st.session_state.map_data is not None: if st.session_state.map_data is not None:
st.subheader("Kartenansicht") st.subheader("Kartenansicht")
st.map(st.session_state.map_data) helper.show_map_folium(st.session_state.map_data)
if st.session_state.graph_data is not None:
fig, ax = plt.subplots()
for segment in st.session_state.graph_data:
x, y = zip(*segment)
ax.plot(x, y, marker='')
ax.set_aspect('equal', adjustable='box')
ax.axis('off')
st.pyplot(fig)

View File

@@ -3,6 +3,10 @@
import math import math
from re import match # für unkennify from re import match # für unkennify
import streamlit as st import streamlit as st
from streamlit_folium import st_folium
import folium
import os
# ***recursive quersummenfunktion*** # ***recursive quersummenfunktion***
def q_sum(n): def q_sum(n):
@@ -172,6 +176,20 @@ def unkennify(text):
decoded = decoded + text[i:] decoded = decoded + text[i:]
return decoded return decoded
def generate_special_files():
out="\n\n\n"
if os.path.exists("./data/morse-de.dic"):
pass
else:
remorse_generate_morsede()
out+=":blue[deutsches Re-Morse-Wörterbuch wurde generiert] \n"
if os.path.exists("./data/t9-de.dic"):
pass
else:
t9_generate_t9de()
out+=":blue[deutsches T9-Wörterbuch wurde generiert] \n"
return out
def remorse_generate_morsede(): def remorse_generate_morsede():
alphabet = {'A': '.-', 'B': '-...', 'C': '-.-.', 'D': '-..', 'E': '.', 'F': '..-.', 'G': '--.', alphabet = {'A': '.-', 'B': '-...', 'C': '-.-.', 'D': '-..', 'E': '.', 'F': '..-.', 'G': '--.',
'H': '....', 'I': '..', 'J': '.---', 'K': '-.-', 'L': '.-..', 'M': '--', 'N': '-.', 'H': '....', 'I': '..', 'J': '.---', 'K': '-.-', 'L': '.-..', 'M': '--', 'N': '-.',
@@ -222,62 +240,6 @@ def t9_generate_t9de():
file.close() file.close()
ofile.close() ofile.close()
def remorse_germandic(eingabetext):
alphabet = {'A': '.-', 'B': '-...', 'C': '-.-.', 'D': '-..', 'E': '.', 'F': '..-.', 'G': '--.',
'H': '....', 'I': '..', 'J': '.---', 'K': '-.-', 'L': '.-..', 'M': '--', 'N': '-.',
'O': '---', 'P': '.--.', 'Q': '--.-', 'R': '.-.', 'S': '...', 'T': '-', 'U': '..-',
'V': '...-', 'W': '.--', 'X': '-..-', 'Y': '-.--', 'Z': '--..', '1': '.----',
'2': '..---', '3': '...--', '4': '....-', '5': '.....', '6': '-....', '7': '--...',
'8': '---..', '9': '----.', '0': '-----', 'Ñ': '--.--', 'É': '..-..', 'È': '.-..-',
'À': '.--.-', 'Ü': '..--', 'Ö': '---.', 'Ä': '.-.-', '_': '..--.-', '@': '.--.-.',
'?': '..--..', '=': '-...-', ';': '-.-.-.', ':': '---...', '/': '-..-.',
'.': '.-.-.-', '-': '-....-', ',': '--..--', '+': '.-.-.', ')': '-.--.-',
'(': '-.--.', "'": '.----.', 'SS': '...--..'}
ualphabet = {v: k for k, v in alphabet.items()}
ualphabet["...--.."] = "ß"
eingabetext = eingabetext.rstrip()
wbfile = open("./data/german.dic", "r", encoding="iso-8859-15")
ausgabetext = ":blue[der eingegebene Morsecode kann für folgendes stehen:] \n"
if eingabetext in ualphabet:
ausgabetext += ualphabet[eingabetext] + " \n"
for zeile in wbfile:
zeile = zeile.strip(" \t\n\r")
mzeile = ""
try:
for char in zeile:
mzeile += alphabet[char.upper()]
except KeyError:
continue
if eingabetext == mzeile:
ausgabetext += zeile + " \n"
wbfile.close()
return ausgabetext
def t9_germandic(eingabetext):
alphabet = {'A': '2', 'B': '2', 'C': '2', 'D': '3', 'E': '3', 'F': '3', 'G': '4',
'H': '4', 'I': '4', 'J': '5', 'K': '5', 'L': '5', 'M': '6', 'N': '6',
'O': '6', 'P': '7', 'Q': '7', 'R': '7', 'S': '7', 'T': '8', 'U': '8',
'V': '8', 'W': '9', 'X': '9', 'Y': '9', 'Z': '9', '1': '1', '2': '2',
'3': '3', '4': '4', '5': '5', '6': '6', '7': '7', '8': '8', '9': '9',
'0': '0', 'Ñ': '6', 'É': '3', 'È': '3', 'À': '2', 'Ü': '8', 'Ö': '6',
'Ä': '2', '@': '1', '?': '1', '=': '0', ':': '1', '/': '1', '.': '1',
'-': '1', ',': '1', '+': '0', ')': '1', '(': '1', 'SS': '7'}
eingabetext = eingabetext.rstrip()
wbfile = open("./data/german.dic", "r", encoding="iso-8859-15")
ausgabetext = ":blue[der eingegebene T9-Code kann für folgendes stehen:] \n"
for zeile in wbfile:
zeile = zeile.strip(" \t\n\r")
mzeile = ""
try:
for char in zeile:
mzeile += alphabet[char.upper()]
except KeyError:
continue
if eingabetext == mzeile:
ausgabetext += zeile + " \n"
wbfile.close()
return ausgabetext
def rail_encrypt(plain_text: str, rails: int): def rail_encrypt(plain_text: str, rails: int):
arr = [["" for _ in range(len(plain_text))] for _ in range(rails)] arr = [["" for _ in range(len(plain_text))] for _ in range(rails)]
r = 0 r = 0
@@ -337,3 +299,34 @@ def rail_decrypt(cipher: str, rails: int):
elif down is False: elif down is False:
y -= 1 y -= 1
return out return out
#from folium.map import DivIcon
def show_map_folium(df):
if not df.empty:
# Schritt 1: Bestimme die südwestliche und nordöstliche Ecke
sw = df[['lat', 'lon']].min().values.tolist() # Südwesten
ne = df[['lat', 'lon']].max().values.tolist() # Nordosten
# Schritt 2: Initialisiere Karte (Ort egal, wird überschrieben, zoom wird bei mehreren Koordinaten überschrieben)
m = folium.Map(location=df[["lat", "lon"]].mean().values.tolist(), zoom_start=15)
# Schritt 3: Marker hinzufügen
for _, row in df.iterrows():
if 'label' in row:
folium.Marker(
location=[row["lat"], row["lon"]],
popup=f"<b>{int(row['label'])}</b><br> Lat:{round(row['lat'], 5)}, Lon:{round(row['lon'], 5)}",
tooltip=f"<b>{int(row['label'])}</b><br> Lat:{round(row['lat'], 5)}, Lon:{round(row['lon'], 5)}",
icon = folium.Icon(color="red", icon="map-marker")
).add_to(m)
else:
folium.Marker(
location=[row["lat"], row["lon"]],
popup=f"Lat:{round(row['lat'], 5)}, Lon:{round(row['lon'], 5)}",
tooltip=f"Lat:{round(row['lat'], 5)}, Lon:{round(row['lon'], 5)}",
icon = folium.Icon(color="red", icon="map-marker")
).add_to(m)
if len(df) != 1:
# Schritt 4: Zoom anpassen bei mehr als einer Koordinate
m.fit_bounds([sw, ne])
# Schritt 5: In Streamlit anzeigen
st_folium(m, use_container_width=True)
else:
st.markdown(":red[Keine sinnvoll darstellbaren Koordinaten gefunden]")

View File

@@ -299,13 +299,9 @@ wortsuche_en = ("### Wortsuche mit Wörterbuch EN\n"
remorse_de = ("### RE-Morse DE\n" remorse_de = ("### RE-Morse DE\n"
"Es gibt ja so Leute, die finden es lustig einen Morsecode so aufzuschreiben, daß zwar Wort für Wort " "Es gibt ja so Leute, die finden es lustig einen Morsecode so aufzuschreiben, daß zwar Wort für Wort "
"getrennt wird, aber ansonsten einfach mal die Leerzeichen weggelassen werden. Bei genau solchen " "getrennt wird, aber ansonsten einfach mal die Leerzeichen weggelassen werden. Bei genau solchen "
"fiesen Gemeinheiten hilft diese Funktion. Diese Funktion benutzt die deutsche Wörterbuchdatei vom " "fiesen Gemeinheiten hilft diese Funktion. Für diese Funktion wurde basierend auf der deutschen "
"Project https://sourceforge.net/projects/germandict \n" "Wörterbuchdatei vom Project https://sourceforge.net/projects/germandict eine "
"Da eine Abfrage relativ lange dauert gibt es die Möglichkeit ein ca. 100 MB großes remorse-de.dic " "spezielle Wörterbuchdatei generiert, um eine beschleunigte Abfrage zu ermöglichen.")
"generieren zu lassen, welches ab der nächsten Abfrage dann genutzt wird und wodurch dann nur noch "
"ca. 20% der Zeit pro Abfrage benötigt wird. Um die Erstellung zu starten muß das Wort GENERATE "
"(Großschreibung beachten!) ins Eingabefeld eingetragen werden und der Funktionsknopf betätigt "
"werden.")
remorse_en = ("### RE-Morse EN\n" remorse_en = ("### RE-Morse EN\n"
"Es gibt ja so Leute, die finden es lustig einen Morsecode so aufzuschreiben, daß zwar Wort für Wort " "Es gibt ja so Leute, die finden es lustig einen Morsecode so aufzuschreiben, daß zwar Wort für Wort "
@@ -320,11 +316,9 @@ t9_de = ("### T9-DE\n"
"enthaltenen Wörter die zu der eingegebenen T9-kodierten Ziffernfolge passen und gibt " "enthaltenen Wörter die zu der eingegebenen T9-kodierten Ziffernfolge passen und gibt "
"diese aus. \n" "diese aus. \n"
"Bsp. 56673462836 liefert das Wort Koordinaten \n" "Bsp. 56673462836 liefert das Wort Koordinaten \n"
"Da eine Abfrage relativ lange dauert gibt es die Möglichkeit ein spezielles t9-Wörterbuch " "Für diese Funktion wurde basierend auf der deutschen Wörterbuchdatei vom Project "
"generieren zu lassen, welches ab der nächsten Abfrage dann genutzt wird und wodurch dann nur noch ca. " "https://sourceforge.net/projects/germandict eine spezielle Wörterbuchdatei generiert, um eine beschleunigte "
"15% der Zeit pro Abfrage benötigt wird. Um die Erstellung des t9-de.dic zu starten muß das Wort " "Abfrage zu ermöglichen.")
"GENERATE (Großschreibung beachten!) ins Eingabefeld eingetragen werden und der Funktionsknopf "
"betätigt werden.")
t9_en = ("### T9-EN\n" t9_en = ("### T9-EN\n"
"Mit Hilfe der englischen Wörterliste en_US-large.txt vom Project " "Mit Hilfe der englischen Wörterliste en_US-large.txt vom Project "
@@ -606,3 +600,11 @@ ook_interpreter = ("### Ook-Interpreter\n"
"Wort Ook vor die Satzzeichen geschrieben. z.B.: Ook! Ook? Ook. Ook! Da Ook auch durch andere " "Wort Ook vor die Satzzeichen geschrieben. z.B.: Ook! Ook? Ook. Ook! Da Ook auch durch andere "
"Wörter ersetzt oder auch ganz ohne Wörter (ShortOok) auftaucht ignoriert diese Funktion alle " "Wörter ersetzt oder auch ganz ohne Wörter (ShortOok) auftaucht ignoriert diese Funktion alle "
"anderen Zeichen außer .!? bevor versucht wird den Code auszuführen.") "anderen Zeichen außer .!? bevor versucht wird den Code auszuführen.")
rlou_to_graph = ("### RLOU/RLUD -> Graph\n"
"Im Grunde genommen ist das hier eigentlich keine Kodierung sondern stellt einfach ein Malanleitung "
"dar. Wobei in der deutschen Version halt R=rechts, L=links, O=oben und U= unten bzw. in der "
"englischen Variante halt L=left, R=right, U=up, D=down ist. \n"
"Die Funktion hier versucht das ganz halt zu malen und als Grafik auszugeben, wobei versucht wird "
"automatisch zu erkennen ob die deutsche oder englische Variante zum Einsatz kommt. \n"
"Zum ausprobieren könnt ihr ja mal `ddurduu ddurduulr ddr rluu ddruul` probieren.")

View File

@@ -172,11 +172,14 @@ def zeichenanzahl(eingabetext):
else: else:
anzahl[b] = 1 anzahl[b] = 1
s = [] s = []
zeichensumme = 0
for key in anzahl: for key in anzahl:
s.append(key) s.append(key)
zeichensumme += anzahl[key]
s.sort() s.sort()
ausgabetext += f"Es wurden __:orange[{len(anzahl)}]__ unterschiedliche Zeichen gefunden. \n" ausgabetext += (f"Es wurden __:orange[{len(anzahl)}]__ unterschiedliche Zeichen in insgesamt "
ausgabetext += "| :blue[Zeichen] | :blue[Anzahl] |\n|----|----|\n" f"__:orange[{zeichensumme}]__ Zeichen gefunden. \n"
f"| :blue[Zeichen] | :blue[Anzahl] |\n|----|----|\n")
for i in s: for i in s:
if ord(i) == 9: if ord(i) == 9:
ausgabetext += f"|TAB|{anzahl[i]}|\n" ausgabetext += f"|TAB|{anzahl[i]}|\n"
@@ -1461,34 +1464,19 @@ def remorse_de(eingabetext):
if eingabetext == "": if eingabetext == "":
return hilfetexte.remorse_de return hilfetexte.remorse_de
else: else:
try: wbfile = open("./data/morse-de.dic", "r", encoding="iso-8859-15")
wbfile = open("./data/morse-de.dic", "r", ausgabetext = ":blue[der eingegebene Morsecode kann für folgendes stehen:] \n"
encoding="iso-8859-15") # german.dic von https://sourceforge.net/projects/germandict/ count = 0
except FileNotFoundError: for zeile in wbfile:
try: zeile = zeile.strip(" \t\n\r")
testfile = open("./data/german.dic", "r") mline = zeile.split(",")
testfile.close() if eingabetext == mline[0]:
if eingabetext == "GENERATE": ausgabetext += mline[1] + " \n"
helper.remorse_generate_morsede() count += 1
return (":green[Remorse-Wörterbuch wurde erzeugt und wird ab dem nächsten Aufruf der Funktion " wbfile.close()
"benutzt.]") if count == 0:
else: return ":red[leider nichts gefunden :disappointed:]"
ausgabetext = (":green[Da das Remorse-Wörterbuch noch nicht generiert wurde, wurde das normale "
"Wörterbuch für die Suche benutzt, das dauert zwar ca. 5x so lange, aber geht "
"auch. \n"
"Um das Remorse-Wörterbuch zu erzeugen bitte das Wort:] :orange[GENERATE] "
":green[ins Eingabefeld eingeben und die Funktion starten.] \n \n")
return ausgabetext + helper.remorse_germandic(eingabetext)
except FileNotFoundError:
return ":red[Leider konnte die Wörterbuchdatei nicht geladen werden.]"
else: else:
ausgabetext = ":blue[der eingegebene Morsecode kann für folgendes stehen:] \n"
for zeile in wbfile:
zeile = zeile.strip(" \t\n\r")
mline = zeile.split(",")
if eingabetext == mline[0]:
ausgabetext += mline[1] + " \n"
wbfile.close()
return ausgabetext return ausgabetext
def remorse_en(eingabetext): def remorse_en(eingabetext):
@@ -1516,6 +1504,7 @@ def remorse_en(eingabetext):
ausgabetext = ":blue[der eingegebene Morsecode kann für folgendes stehen:] \n" ausgabetext = ":blue[der eingegebene Morsecode kann für folgendes stehen:] \n"
if eingabetext in ualphabet: if eingabetext in ualphabet:
ausgabetext += ualphabet[eingabetext] + " \n" ausgabetext += ualphabet[eingabetext] + " \n"
count = 0
for zeile in wbfile: for zeile in wbfile:
zeile = zeile.strip(" \t\n\r") zeile = zeile.strip(" \t\n\r")
mzeile = "" mzeile = ""
@@ -1526,39 +1515,31 @@ def remorse_en(eingabetext):
continue continue
if eingabetext == mzeile: if eingabetext == mzeile:
ausgabetext += zeile + " \n" ausgabetext += zeile + " \n"
count += 1
wbfile.close() wbfile.close()
return ausgabetext if count == 0:
return ":red[leider nichts gefunden :disappointed:]"
else:
return ausgabetext
def t9_de(eingabetext): def t9_de(eingabetext):
eingabetext = eingabetext.rstrip() eingabetext = eingabetext.rstrip()
if eingabetext == "": if eingabetext == "":
return hilfetexte.t9_de return hilfetexte.t9_de
else: else:
try: wbfile = open("./data/t9-de.dic", "r", encoding="iso-8859-15")
wbfile = open("./data/t9-de.dic", "r", encoding="iso-8859-15") ausgabetext = ":blue[der eingegebene T9-Code kann für folgendes stehen:] \n"
except FileNotFoundError: count = 0
try: for zeile in wbfile:
testfile = open("./data/german.dic", "r") zeile = zeile.strip(" \t\n\r")
testfile.close() mline = zeile.split(",")
if eingabetext == "GENERATE": if eingabetext == mline[0]:
helper.t9_generate_t9de() ausgabetext += mline[1] + " \n"
return ":green[t9-Wörterbuch wurde erzeugt und wird ab dem nächsten Aufruf der Funktion benutzt.]" count += 1
else: wbfile.close()
ausgabetext = (":green[Da das T9-Wörterbuch nicht vorhanden ist, wurde das normale Wörterbuch für " if count == 0:
"die Suche benutzt. Das dauert zwar ca. 7x so lange, aber geht auch. \n" return ":red[leider nichts gefunden :disappointed:]"
"Um das spezielle T9-Wörterbuch zu erzeugen bitte das Wort:] :orange[GENERATE] "
":green[ins Eingabefeld eingeben und die Funktion starten.] \n \n")
return ausgabetext + helper.t9_germandic(eingabetext)
except FileNotFoundError:
return ":red[Leider konnte die Wörterbuchdatei nicht geladen werden.]"
else: else:
ausgabetext = ":blue[der eingegebene T9-Code kann für folgendes stehen:] \n"
for zeile in wbfile:
zeile = zeile.strip(" \t\n\r")
mline = zeile.split(",")
if eingabetext == mline[0]:
ausgabetext += mline[1] + " \n"
wbfile.close()
return ausgabetext return ausgabetext
def t9_en(eingabetext): def t9_en(eingabetext):
@@ -1580,6 +1561,7 @@ def t9_en(eingabetext):
return ":red[Leider konnte die Wörterbuchdatei nicht geladen werden.]" return ":red[Leider konnte die Wörterbuchdatei nicht geladen werden.]"
else: else:
ausgabetext = ":blue[der eingegebene T9-Code kann für folgendes stehen:] \n" ausgabetext = ":blue[der eingegebene T9-Code kann für folgendes stehen:] \n"
count = 0
for zeile in wbfile: for zeile in wbfile:
zeile = zeile.strip(" \t\n\r") zeile = zeile.strip(" \t\n\r")
mzeile = "" mzeile = ""
@@ -1590,8 +1572,12 @@ def t9_en(eingabetext):
continue continue
if eingabetext == mzeile: if eingabetext == mzeile:
ausgabetext += zeile + " \n" ausgabetext += zeile + " \n"
count += 1
wbfile.close() wbfile.close()
return ausgabetext if count == 0:
return ":red[leider nichts gefunden :disappointed:]"
else:
return ausgabetext
def vigenere(eingabetext, pw): def vigenere(eingabetext, pw):
bw = {'A': 1, 'B': 2, 'C': 3, 'D': 4, 'E': 5, 'F': 6, 'G': 7, 'H': 8, 'I': 9, 'J': 10, 'K': 11, 'L': 12, 'M': 13, bw = {'A': 1, 'B': 2, 'C': 3, 'D': 4, 'E': 5, 'F': 6, 'G': 7, 'H': 8, 'I': 9, 'J': 10, 'K': 11, 'L': 12, 'M': 13,
@@ -2057,7 +2043,7 @@ def maptiles_kachelkoordinaten(eingabetext):
try: try:
la = float(text[0]) la = float(text[0])
lo = float(text[1]) lo = float(text[1])
if not la < -85.05113 and not la > 85.05113 and not lo < -180 and not lo > 180: if not la < -83.0 and not la > 83.0 and not lo < -180 and not lo > 180:
x, y = helper.dec_to_maptiles(la, lo, zoom) x, y = helper.dec_to_maptiles(la, lo, zoom)
ausgabetext += f"|{zoom:>2}|{x:<10}|{y}|\n" ausgabetext += f"|{zoom:>2}|{x:<10}|{y}|\n"
except ValueError: except ValueError:
@@ -2065,17 +2051,18 @@ def maptiles_kachelkoordinaten(eingabetext):
return ausgabetext, None return ausgabetext, None
elif len(text) == 2: elif len(text) == 2:
ausgabetext = ":violet[Maptiles->DEG,DEC] \n|:blue[Zoom]|:blue[DEG]|:blue[DEC]|\n|-|-|-|\n" ausgabetext = ":violet[Maptiles->DEG,DEC] \n|:blue[Zoom]|:blue[DEG]|:blue[DEC]|\n|-|-|-|\n"
lat_list, lon_list = [], [] lat_list, lon_list, label_list = [], [], []
for zoom in range(2, 26): for zoom in range(2, 26):
try: try:
la, lo = helper.maptiles_to_dec(int(text[0]), int(text[1]), zoom) la, lo = helper.maptiles_to_dec(int(text[0]), int(text[1]), zoom)
if not la < -85.05113 and not la > 85.05113 and not lo < -180 and not lo > 180: if not la < -83.0 and not la > 83.0 and not lo < -180 and not lo > 180:
ausgabetext += f"|{zoom:>2}|{helper.dec_to_deg(la, lo):<23}|{round(la, 5)} {round(lo, 5)}| \n" ausgabetext += f"|{zoom:>2}|{helper.dec_to_deg(la, lo):<23}|{round(la, 5)} {round(lo, 5)}| \n"
lat_list.append(la) lat_list.append(la)
lon_list.append(lo) lon_list.append(lo)
label_list.append(zoom)
except OverflowError: except OverflowError:
pass pass
return ausgabetext, pd.DataFrame({'lat': lat_list, 'lon': lon_list}) return ausgabetext, pd.DataFrame({'lat': lat_list, 'lon': lon_list, 'label': label_list})
else: else:
return ":red[Zahlen konnten nicht ermittelt werden!]", None return ":red[Zahlen konnten nicht ermittelt werden!]", None
@@ -2662,3 +2649,30 @@ def text_to_ook(eingabetext):
for z in short_ook: for z in short_ook:
ook_txt += f"Ook{z} " ook_txt += f"Ook{z} "
return f":blue[Short-Ook:] \n{short_ook} \n \n:blue[Ook:] \n{ook_txt}" return f":blue[Short-Ook:] \n{short_ook} \n \n:blue[Ook:] \n{ook_txt}"
def rlou_to_graph(eingabetext):
eingabetext = eingabetext.rstrip()
if eingabetext == "":
return hilfetexte.rlou_to_graph, None
else:
if "O" in eingabetext.upper():
moves = {'R': (1, 0), 'L': (-1, 0), 'O': (0, 1), 'U': (0, -1)}
elif "D" in eingabetext.upper():
moves = {'R': (1, 0), 'L': (-1, 0), 'U': (0, 1), 'D': (0, -1)}
else:
return (":red[Es wurde weder ein O oder ein D gefunden um festzustellen ob RLOU oder RLUD verwendet werden"
"soll]"), None
directions_list = eingabetext.split()
x, y = 0, 0
path = []
for directions in directions_list:
part = [(x,y)]
for d in directions.upper():
if d in moves:
dx, dy = moves[d]
x += dx
y += dy
part.append((x, y))
path.append(part)
x += 3
return f":blue[Graph:]", path

View File

@@ -1,84 +0,0 @@
# Copyright (c) 2025 Martin Kayser (tebarius)
# Licensed under the MIT License. See LICENSE file in the project root.
# start with: streamlit run examples.py
import streamlit as st
st.write("# Hello World !")
import pandas as pd
df = pd.DataFrame({
'first column': [1, 2, 3, 4],
'second column': [10, 20, 30, 40]
})
df
st.table(df)
import pandas as pd
st.map(pd.DataFrame({'lat':[52.3642], 'lon':[13.0906]}), zoom=17, size=5)
import streamlit as st
x = st.slider('x', 32, 233) # 👈 this is a widget
st.write(x, 'squared is', x * x)
st.text_input("Your name", key="name")
# You can access the value at any point with:
st.session_state.name
import numpy as np
import pandas as pd
if st.checkbox('Show dataframe'):
chart_data = pd.DataFrame(
np.random.randn(20, 3),
columns=['a', 'b', 'c'])
chart_data
import pandas as pd
df = pd.DataFrame({
'first column': [1, 2, 3, 4],
'second column': [10, 20, 30, 40]
})
option = st.selectbox(
'Which number do you like best?',
df['first column'])
'You selected: ', option
add_selectbox = st.sidebar.selectbox(
'How would you like to be contacted?',
('Email', 'Home phone', 'Mobile phone')
)
# Add a slider to the sidebar:
add_slider = st.sidebar.slider(
'Select a range of values',
0.0, 100.0, (25.0, 75.0)
)
add_selectbox
add_slider
left_column, right_column = st.columns(2)
# You can use a column just like st.sidebar:
left_column.button('Press me!')
# Or even better, call Streamlit functions inside a "with" block:
with right_column:
chosen = st.radio(
'Sorting hat',
("Gryffindor", "Ravenclaw", "Hufflepuff", "Slytherin"))
st.write(f"You are in {chosen} house!")
st.progress(80)
st.text_area("Your text", key="te")
st.session_state.te

Binary file not shown.

Before

Width:  |  Height:  |  Size: 159 KiB

View File

@@ -1,47 +0,0 @@
<!--
Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022-2025)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1, shrink-to-fit=no"
/>
<link rel="shortcut icon" href="./favicon.ico" />
<link
rel="preload"
href="./static/media/SourceSansVF-Upright.ttf.BsWL4Kly.woff2"
as="font"
type="font/woff2"
crossorigin
/>
<title>tebarius Mysteryhelfer (web)</title>
<!-- initialize window.prerenderReady to false and then set to true in React app when app is ready for indexing -->
<script>
window.prerenderReady = false
</script>
<script type="module" crossorigin src="./static/js/index.BTGIlECR.js"></script>
<link rel="stylesheet" crossorigin href="./static/css/index.CJVRHjQZ.css">
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
</body>
</html>

View File

@@ -7,22 +7,34 @@ Für die Umsetzung kommt das Python-Framework [Streamlit](https://streamlit.io/)
Der einfachst Weg, um die App lokal laufen zu lassen, ist mit Docker, wobei ich hier mal 3 Möglichkeiten aufzeigen (_das vorgebaute Image ist als Multi-Arch-Image für linux/amd64,linux/arm64 gebaut und sollte somit z.B. auch auf Mac's und neueren Raspberry's mit 64 bit Betriebssystem laufen_): Der einfachst Weg, um die App lokal laufen zu lassen, ist mit Docker, wobei ich hier mal 3 Möglichkeiten aufzeigen (_das vorgebaute Image ist als Multi-Arch-Image für linux/amd64,linux/arm64 gebaut und sollte somit z.B. auch auf Mac's und neueren Raspberry's mit 64 bit Betriebssystem laufen_):
1. mit vorgebautem Image: 1. mit vorgebautem Image:
- `docker run --rm -d -p 8501:8501 gitea.tebarius.duckdns.org/tebarius/mysteryhelfer` - `docker run --rm -d -p 8501:8501 gitea.tebarius.duckdns.org/tebarius/mysteryhelfer`
- alternativ (via Docker Hub): `docker run --rm -d -p 8501:8501 tebarius/mysteryhelfer`
2. mit vorgebautem Image und "docker compose" 2. mit vorgebautem Image und "docker compose"
- docker-compose.yml erstellen mit folgendem Inhalt: - docker-compose.yml erstellen mit folgendem Inhalt:
``` ```
services: services:
mysteryhelfer-web: mysteryhelfer-web:
image: gitea.tebarius.duckdns.org/tebarius/mysteryhelfer image: gitea.tebarius.duckdns.org/tebarius/mysteryhelfer
ports: ports:
- "8501:8501" - "8501:8501"
restart: unless-stopped restart: unless-stopped
``` ```
- `docker compose up` alternativ (via Docker Hub):
```
services:
mysteryhelfer-web:
image: tebarius/mysteryhelfer
ports:
- "8501:8501"
restart: unless-stopped
```
- `docker compose up -d`
3. mit selbst gebautem Image aus dem Quellcode 3. mit selbst gebautem Image aus dem Quellcode
- `git clone https://gitea.tebarius.duckdns.org/tebarius/Mysteryhelfer-web.git` - `git clone https://gitea.tebarius.duckdns.org/tebarius/Mysteryhelfer-web.git`
- `cd Mysteryhelfer-web` - `cd Mysteryhelfer-web`
- `docker compose up` - `docker compose up -d`
bei allen 3 Varianten ist die App anschließend im Browser unter http://127.0.0.1:8501/ aufrufbar bei allen 3 Varianten ist die App anschließend im Browser unter http://127.0.0.1:8501/ aufrufbar
__HINWEIS: Beim ersten Aufruf der Adresse werden Special-Wörterbücher für RE-Morse und T9 generiert,
was ca. 15-30s in Anspruch nimmt und dadurch das Laden der Seite einmalig verzögert.__

Binary file not shown.