summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcashmere <cashmere@autistici.org>2026-06-19 22:43:44 +0200
committercashmere <cashmere@autistici.org>2026-06-19 22:43:44 +0200
commit0eba0062e84b52afa2afbbb797fbaa2ec9a2344f (patch)
tree7a11890f9ab1814f5613e26f17e41f542bd8ee71
parent167f2770fd631c3f168c3f11e6c4ae34f0edf672 (diff)
downloadtechnical-renaissance-0eba0062e84b52afa2afbbb797fbaa2ec9a2344f.tar.gz
app.py: read and type config.toml
-rw-r--r--src/technical_renaissance/app.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/technical_renaissance/app.py b/src/technical_renaissance/app.py
index 3ce2efe..a35ec2d 100644
--- a/src/technical_renaissance/app.py
+++ b/src/technical_renaissance/app.py
@@ -1,5 +1,18 @@
+from typing import cast
+import tomllib
+from pathlib import Path
from robyn import Request
from robyn import Robyn
+from typing import TypedDict
+
+
+User = TypedDict("User", {"name": str, "url": str, "description": str})
+Config = TypedDict("Config", {"user": list[User]})
+
+
+def return_config(path: Path) -> Config:
+ with path.open("rb") as config:
+ return cast(Config, tomllib.load(config))
app = Robyn(__file__)