Module secfsdstools.d_container.presentation

Base class for Presenter implementations.

Expand source code
"""
Base class for Presenter implementations.
"""
from abc import abstractmethod

from typing import TypeVar, Generic

import pandas as pd

T = TypeVar('T')


class Presenter(Generic[T]):
    """
    The base class for presenter implementations.
    """

    @abstractmethod
    def present(self, databag: T) -> pd.DataFrame:
        """
        implements a presenter which reformats the bag into dataframe.
        Args:
            databag (T): the bag to transform into presentation df

        Returns:
            pd.DataFrame: the data to be presented
        """

Classes

class Presenter (*args, **kwds)

The base class for presenter implementations.

Expand source code
class Presenter(Generic[T]):
    """
    The base class for presenter implementations.
    """

    @abstractmethod
    def present(self, databag: T) -> pd.DataFrame:
        """
        implements a presenter which reformats the bag into dataframe.
        Args:
            databag (T): the bag to transform into presentation df

        Returns:
            pd.DataFrame: the data to be presented
        """

Ancestors

  • typing.Generic

Subclasses

Methods

def present(self, databag: ~T) ‑> pandas.core.frame.DataFrame

implements a presenter which reformats the bag into dataframe.

Args

databag : T
the bag to transform into presentation df

Returns

pd.DataFrame
the data to be presented
Expand source code
@abstractmethod
def present(self, databag: T) -> pd.DataFrame:
    """
    implements a presenter which reformats the bag into dataframe.
    Args:
        databag (T): the bag to transform into presentation df

    Returns:
        pd.DataFrame: the data to be presented
    """