From 3a09c707ba2ba50ca3d3941ebe9ae9ea7c3f04bf Mon Sep 17 00:00:00 2001 From: Leonard Kugis Date: Mon, 22 Dec 2025 22:53:48 +0100 Subject: Initial commit --- modules/base.py | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 modules/base.py (limited to 'modules/base.py') 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: + ... + -- cgit v1.2.3