import json
import urllib.request

from nicegui import ui, app


import segno

@app.get("/data")
async def deliver_data():
    with open("settings.json") as json_file:
        data = json.load(json_file)
    return data

string = ""
for i in range(1000):
    string += str(i)

qr_code = segno.make_qr(string).svg_data_uri()
#qr_code.save("qr_code.png", scale=5, border=0)
ui.image(qr_code)

ui.run(language="de-DE", port=9000)