scitex_hub.module
SciTeX Hub Module – decorator and output APIs for custom workspace modules.
Example
from scitex_hub.module import module, output, html, INJECTED
@module(label="My Analysis", icon="fa-brain", category="analysis")
def my_analysis(project=INJECTED, plt=INJECTED):
output(df, title="Raw Data")
- scitex_hub.module.module(func: Callable = None, *, label: str = '', icon: str = 'fa-puzzle-piece', category: str = 'other', description: str = '', version: str = '0.1.0', dependencies: list | None = None, min_scitex_version: str = '') Callable[source]
Decorator to mark a function as a SciTeX workspace module.
The decorated function can declare parameters with default=INJECTED; the module runner will supply project, plt, and logger at execution time.
- class scitex_hub.module.ModuleManifest(name: str = '', label: str = '', icon: str = 'fa-puzzle-piece', category: str = 'other', description: str = '', version: str = '0.1.0', dependencies: list = <factory>, min_scitex_version: str = '')[source]
Metadata for a SciTeX workspace module.
- Variables:
name (Auto-generated slug from the decorated function name.)
label (Human-readable display name shown in the UI.)
icon (FontAwesome class (e.g. "fa-brain").)
category (One of the VALID_CATEGORIES.)
description (Short description of what the module does.)
version (Semantic version string.)
dependencies (Extra pip packages required by this module.)
min_scitex_version (Minimum scitex version required (empty = any).)
- classmethod from_dict(data: dict) ModuleManifest[source]
Construct a ModuleManifest from a dictionary.
- class scitex_hub.module.ModuleOutput(value: Any = None, title: str = '', output_type: str = '')[source]
Single output item produced by a module function.
- class scitex_hub.module.ModuleOutputCollector[source]
Thread-local collector that accumulates outputs during module execution.
- classmethod get_current() list[ModuleOutput][source]
Return the output list for the current thread.
- scitex_hub.module.output(value: Any, title: str = '') None[source]
Add an output to the current module execution.
This is the primary API researchers call inside their module function to register figures, tables, text, or HTML for display.
- scitex_hub.module.html(content: str) _SafeHtml[source]
Mark a string as safe HTML so the renderer emits it without escaping.