cement.core.output

Cement core output module.

class cement.core.output.OutputHandler(**kw: Any)[source]

Bases: OutputInterface, Handler

Output handler implementation.

class Meta[source]

Bases: Meta

class cement.core.output.OutputInterface(**kw: Any)[source]

Bases: Interface

This class defines the Output Interface. Handlers that implement this interface must provide the methods and attributes defined below. In general, most implementations should sub-class from the provided OutputHandler base class as a starting point.

class Meta[source]

Bases: Meta

Handler meta-data.

interface: str = 'output'

The string identifier of the interface

abstract render(data: Dict[str, Any], *args: Any, **kwargs: Any) str | None[source]

Render the data dict into output in some fashion. This function must accept both *args and **kwargs to allow an application to mix output handlers that support different features.

Parameters:

data (dict) – The dictionary whose data we need to render into output.

Returns:

The rendered output string, or None if no output is rendered

Return type:

str, None