formatter_factory
Worker formatter factory for Merlin.
This module provides the WorkerFormatterFactory, a central registry and
factory class for managing supported worker formatter implementations.
It allows clients to create worker formatters by name or alias, ensuring
consistent handling of different output formats (e.g., JSON, Rich).
WorkerFormatterFactory
Bases: MerlinBaseFactory
Factory class for managing and instantiating supported Merlin worker formatters.
This subclass of MerlinBaseFactory handles registration, validation,
and instantiation of worker formatters (e.g., rich, json).
Attributes:
| Name | Type | Description |
|---|---|---|
_registry |
Dict[str, WorkerFormatter]
|
Maps canonical formatter names to formatter classes. |
_aliases |
Dict[str, str]
|
Maps legacy or alternate names to canonical formatter names. |
Methods:
| Name | Description |
|---|---|
register |
Register a new formatter class and optional aliases. |
list_available |
Return a list of supported formatter names. |
create |
Instantiate a formatter class by name or alias. |
get_component_info |
Return metadata about a registered formatter. |