base
tit.reporting.core.base ¶
Base reportlet classes for the TI-Toolbox reporting system.
This module provides the foundational reportlet implementations that can be used directly or extended for specialized purposes.
BaseReportlet ¶
BaseReportlet(title: str | None = None)
Bases: ABC
Abstract base class for all reportlets.
Source code in tit/reporting/core/base.py
reportlet_type
abstractmethod
property
¶
reportlet_type: ReportletType
Return the type of this reportlet.
MetadataReportlet ¶
MetadataReportlet(data: dict[str, Any], title: str | None = None, display_mode: str = 'table', columns: int = 2)
Bases: BaseReportlet
Reportlet for displaying metadata as key-value pairs.
Supports two display modes: - 'table': Traditional table layout - 'cards': Modern card grid layout
Source code in tit/reporting/core/base.py
ImageReportlet ¶
ImageReportlet(image_source: str | Path | bytes | Any | None = None, title: str | None = None, caption: str | None = None, alt_text: str | None = None, width: str | None = None, height: str | None = None)
Bases: BaseReportlet
Reportlet for displaying images.
Supports embedding images as base64 or referencing external paths. Images can be loaded from file paths, PIL Images, or raw bytes.
Source code in tit/reporting/core/base.py
set_base64_data ¶
render_html ¶
render_html() -> str
Render image as HTML.
Source code in tit/reporting/core/base.py
TableReportlet ¶
TableReportlet(data: list[dict] | list[list] | Any, title: str | None = None, headers: list[str] | None = None, sortable: bool = False, striped: bool = True, compact: bool = False)
Bases: BaseReportlet
Reportlet for displaying tabular data.
Supports various input formats including lists of dicts, lists of lists, and pandas DataFrames.
Source code in tit/reporting/core/base.py
render_html ¶
render_html() -> str
Render table as HTML.
Source code in tit/reporting/core/base.py
TextReportlet ¶
TextReportlet(content: str, title: str | None = None, content_type: str = 'text', copyable: bool = False, monospace: bool = False)
Bases: BaseReportlet
Reportlet for displaying text content.
Supports plain text, HTML, and markdown-style formatting. Includes optional copy-to-clipboard functionality for boilerplate text.
Source code in tit/reporting/core/base.py
render_html ¶
render_html() -> str
Render text content as HTML.
Source code in tit/reporting/core/base.py
ErrorReportlet ¶
Bases: BaseReportlet
Reportlet for displaying errors and warnings.
Supports different severity levels with appropriate styling.
Source code in tit/reporting/core/base.py
add_message ¶
add_message(message: str, severity: SeverityLevel = ERROR, context: str | None = None, step: str | None = None) -> None
Add an error or warning message.
Source code in tit/reporting/core/base.py
add_error ¶
add_warning ¶
render_html ¶
render_html() -> str
Render errors and warnings as HTML.
Source code in tit/reporting/core/base.py
ReferencesReportlet ¶
Bases: BaseReportlet
Reportlet for displaying citations and references.
Automatically formats references in a consistent style.
Source code in tit/reporting/core/base.py
add_reference ¶
Add a reference.
Source code in tit/reporting/core/base.py
render_html ¶
render_html() -> str
Render references as HTML.