Umsatzsteuerumrechnungskurse des BMF ab dem Jahr 2022 CSV-Files with Pandas using PyScript presented by MHApps
packages = ["pandas","matplotlib"]
import warnings
warnings.filterwarnings("ignore")
from js import console, document
import pandas as pd
from pyodide.http import open_url
#url_content = open_url("ustkurse.csv")
#df = pd.read_csv(url_content, index_col=0)
#csv = Element('csv')
#csv.write(df)
# Set up a proxy to be called when a 'change'
# event occurs in the select control
from js import document
from pyodide.ffi import create_proxy
# Read the value of the select control
# and call 'plot'
def selectChange(event):
document.getElementById("csv").innerHTML = ""
choice = document.getElementById("select").value
#print(choice)
if choice == "2023":
#url_content = open_url("http://majo2000.bplaced.net/python/ustkurse2023.csv")
url_content = open_url("ustkurse2023.csv")
df = pd.read_csv(url_content, index_col=0)
csv = Element('csv')
csv.write(df)
else:
url_content = open_url("ustkurse.csv")
df = pd.read_csv(url_content, index_col=0)
csv = Element('csv')
csv.write(df)
# set the proxy
def setup():
# Create a JsProxy for the callback function
change_proxy = create_proxy(selectChange)
e = document.getElementById("select")
e.addEventListener("change", change_proxy)
setup()