collective.transmute.layout#

class collective.transmute.layout.ApplicationLayout[source]#

Base layout for the application.

Parameters:

title (str) -- The title for the layout.

title#

The layout title.

Type:

str

layout#

The Rich Layout object.

Type:

Layout

consoles#

The console area for logs and side info.

Type:

ConsoleArea

progress#

The progress bar object.

Type:

ReportProgress or PipelineProgress

Example

>>> layout = ApplicationLayout('My App')
__init__(title: str)[source]#
_create_layout(title: str) Layout[source]#

Create the Rich Layout for the application.

Parameters:

title (str) -- The title for the layout.

Returns:

The Rich Layout object.

Return type:

Layout

initialize_progress(total: int) None[source]#

Initialize the progress bar.

Parameters:

total (int) -- The total number of items to process.

update_layout(state: PipelineState | ReportState) None[source]#

Update the layout with the current state.

Parameters:

state (PipelineState or ReportState) -- The state object containing progress and report data.

class collective.transmute.layout.Header[source]#

Display a header panel for the application.

Parameters:

title (str) -- The title to display in the header.

Example

>>> header = Header("My Title")
>>> panel = header.__rich__()
__init__(title: str)[source]#
class collective.transmute.layout.ReportLayout[source]#

Layout for displaying report information.

Example

>>> layout = ReportLayout('Report')
_create_layout(title: str) Layout[source]#

Create the layout for the report.

Parameters:

title (str) -- The title for the layout.

Returns:

The Rich Layout object.

Return type:

Layout

initialize_progress(total: int) None[source]#

Initialize the progress bar for the report.

Parameters:

total (int) -- The total number of items to process.

update_layout(state: ReportState) None[source]#

Update the layout with the report state.

Parameters:

state (ReportState) -- The report state object.

class collective.transmute.layout.TransmuteLayout[source]#

Layout for the transmute pipeline application.

Example

>>> layout = TransmuteLayout('Transmute')
_create_layout(title: str) Layout[source]#

Create the layout for the transmute pipeline.

Parameters:

title (str) -- The title for the layout.

Returns:

The Rich Layout object.

Return type:

Layout

initialize_progress(total: int) None[source]#

Initialize the progress bar for the pipeline.

Parameters:

total (int) -- The total number of items to process.

update_layout(state: PipelineState) None[source]#

Update the layout with the pipeline state.

Parameters:

state (PipelineState) -- The pipeline state object.

class collective.transmute.layout.TransmuteReport[source]#

Display a report panel with metadata information.

Parameters:
  • data (dict[str, int]) -- The data to display in the report.

  • title (str) -- The title of the report panel.

  • limit (int, optional) -- Maximum length for item names (default: 30).

Example

>>> report = TransmuteReport({'TypeA': 10, 'TypeB': 5}, 'Exported')
>>> panel = report.__rich__()
__init__(data: dict[str, int], title: str, limit: int = 30)[source]#
collective.transmute.layout.create_consoles() ConsoleArea[source]#

Create a ConsoleArea object with two console panels.

Returns:

An object containing main and side consoles.

Return type:

ConsoleArea

Example

>>> consoles = create_consoles()
collective.transmute.layout.live(app_layout: ApplicationLayout, redirect_stderr: bool = True) Live[source]#

Create a Rich Live instance for the given application layout.

Parameters:
  • app_layout (ApplicationLayout) -- The application layout to display.

  • redirect_stderr (bool, optional) -- Whether to redirect stderr to the live display (default: True).

Returns:

A Rich Live instance for the layout.

Return type:

Live

Example

>>> live_display = live(layout)
collective.transmute.layout.progress_panel(progress: PipelineProgress | ReportProgress) Panel[source]#

Create a progress panel for the current pipeline or report progress.

Parameters:

progress (PipelineProgress or ReportProgress) -- The progress object to display.

Returns:

A Rich Panel object showing progress.

Return type:

Panel