Compare commits
6 Commits
4c805d85ca
...
0.6.0
| Author | SHA1 | Date | |
|---|---|---|---|
| 6939c01883 | |||
| 2a380c5066 | |||
| 823dce7f8f | |||
| fecce2fd8c | |||
| 2be61aac72 | |||
| 8987e95775 |
@@ -6,7 +6,7 @@ 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.6.0'
|
||||||
|
|
||||||
env:
|
env:
|
||||||
image_name: mysteryhelfer
|
image_name: mysteryhelfer
|
||||||
|
|||||||
99
app/app.py
99
app/app.py
@@ -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
|
||||||
|
from helper import show_map_folium
|
||||||
|
|
||||||
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:
|
||||||
@@ -294,6 +226,8 @@ if 'output_text' not in st.session_state:
|
|||||||
st.session_state.output_text = standard_output
|
st.session_state.output_text = standard_output
|
||||||
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 +319,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 +361,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)
|
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)
|
||||||
|
|||||||
@@ -3,6 +3,9 @@
|
|||||||
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
|
||||||
|
|
||||||
|
|
||||||
# ***recursive quersummenfunktion***
|
# ***recursive quersummenfunktion***
|
||||||
def q_sum(n):
|
def q_sum(n):
|
||||||
@@ -337,3 +340,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]")
|
||||||
@@ -606,3 +606,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.")
|
||||||
36
app/tools.py
36
app/tools.py
@@ -2057,7 +2057,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 +2065,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 +2663,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
|
||||||
|
|||||||
BIN
requirements.txt
BIN
requirements.txt
Binary file not shown.
Reference in New Issue
Block a user