aboutsummaryrefslogtreecommitdiffstats
path: root/modules/base.py
diff options
context:
space:
mode:
authorLeonard Kugis <leonard@kug.is>2025-12-22 22:53:48 +0100
committerLeonard Kugis <leonard@kug.is>2025-12-22 22:53:48 +0100
commit3a09c707ba2ba50ca3d3941ebe9ae9ea7c3f04bf (patch)
tree51c45fe7deab17482adc2d8d3c253e392ff6a825 /modules/base.py
downloadxembu-3a09c707ba2ba50ca3d3941ebe9ae9ea7c3f04bf.tar.gz
Initial commit
Diffstat (limited to 'modules/base.py')
-rw-r--r--modules/base.py39
1 files changed, 39 insertions, 0 deletions
diff --git a/modules/base.py b/modules/base.py
new file mode 100644
index 0000000..7d04644
--- /dev/null
+++ b/modules/base.py
@@ -0,0 +1,39 @@
+from dataclasses import dataclass
+from typing import Any, Dict, List, Protocol
+
+import matplotlib.pyplot as plt
+from matplotlib.axes import Axes
+from matplotlib.font_manager import FontProperties
+
+
+@dataclass
+class Frame:
+ title: str
+
+ def render(self, ax: Axes, mono_font: FontProperties) -> None:
+ raise NotImplementedError
+
+@dataclass
+class BigFrame:
+ """
+ Nimmt eine halbe PDF-Seite ein (Renderer packt 2 BigFrames pro Seite).
+ """
+ title: str
+
+ def render(self, ax: Axes, mono_font: FontProperties) -> None:
+ raise NotImplementedError
+
+@dataclass
+class ModuleResult:
+ summary_text: str # NEU: wird im Hauptprogramm in die Konsole gedruckt
+ frames: List[Frame] # Kacheln (optional)
+ bigframes: List[BigFrame]
+ pages: List[plt.Figure] # Vollseiten (optional)
+
+
+class Module(Protocol):
+ name: str
+
+ def process(self, df, context: Dict[str, Any]) -> ModuleResult:
+ ...
+