assets_guardian.core.domain.ports.sheet_builders๏ƒ

Classes

ISheetBuilder()

Port: Excel sheet builder (Plugin).

class assets_guardian.core.domain.ports.sheet_builders.ISheetBuilder[source]๏ƒ

Bases: ABC

Port: Excel sheet builder (Plugin).

Contract for plugins wishing to add specific sheets to the Excel referential.

abstractmethod build(worksheet: Any, data: Any, preserved: Any, rules: Any) None[source]๏ƒ

Builds the Excel sheet for this plugin.

Parameters:
  • worksheet โ€“ The Excel sheet (ExcelWorksheet).

  • data โ€“ Dictionary of collection results (source, instance) -> CollectorResult.

  • preserved โ€“ Manual data extracted from the existing sheet for preservation.

  • rules โ€“ Formatting and validation rules.

abstractmethod get_rules() dict[str, Any][source]๏ƒ

Returns plugin-specific Excel formatting rules.

abstract property preserved_columns: dict[str, dict[str, list[str]]]๏ƒ

Defines the columns to preserve per sheet.

Example:

{
    'Sheet1': {'primary_keys': ['ID'], 'columns': ['Comments']},
    'Sheet2': {'primary_keys': ['UUID'], 'columns': ['Account Type']}
}
abstract property sheet_names: list[str]๏ƒ

List of Excel sheet names managed by this builder.