From 9451fa019cb084db820f3255b0da2cc863d0f990 Mon Sep 17 00:00:00 2001 From: Aki Date: Mon, 3 Apr 2023 23:15:09 +0200 Subject: Implemented naive web view --- pyproject.toml | 1 + waterspout_radar/web.py | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 waterspout_radar/web.py diff --git a/pyproject.toml b/pyproject.toml index 94896c5..a0b3b65 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,7 @@ [project] name="waterspout-radar" dependencies=[ + "flask==2.*", "geopy==2.*", "metpy==1.*", "szilagyi", diff --git a/waterspout_radar/web.py b/waterspout_radar/web.py new file mode 100644 index 0000000..67ac4ca --- /dev/null +++ b/waterspout_radar/web.py @@ -0,0 +1,17 @@ +import flask + +from . import _storage + +app = flask.Flask(__name__) + + +@app.route("/") +def predictions(): + body = "Predictions" + body += "

Prediction


" + body += "" + body += "" + for prediction in sorted(_storage.Storage(".waterspout/predictions.json"), key=lambda x: (x.time, x.swi)): + body += f"" + body += "
TimeΔTempDepthSWI
{prediction.time}{prediction.temperature_difference}{prediction.convective_cloud_depth}{prediction.swi}
" + return body -- cgit v1.1