Module secfsdstools.d_container.filter

Base class for Filter implementations.

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

from typing import TypeVar, Generic

T = TypeVar('T')


class FilterBase(Generic[T]):
    """
    Basic filter definition.
    """

    @abstractmethod
    def filter(self, databag: T) -> T:
        """
        implements a simple filter on the RawDataBag and produces a new databag
        Args:
            databag (T): the bag to apply the filter to

        Returns:
            T: the new  bag with the filtered content

        """

Classes

class FilterBase (*args, **kwds)

Basic filter definition.

Expand source code
class FilterBase(Generic[T]):
    """
    Basic filter definition.
    """

    @abstractmethod
    def filter(self, databag: T) -> T:
        """
        implements a simple filter on the RawDataBag and produces a new databag
        Args:
            databag (T): the bag to apply the filter to

        Returns:
            T: the new  bag with the filtered content

        """

Ancestors

  • typing.Generic

Subclasses

Methods

def filter(self, databag: ~T) ‑> ~T

implements a simple filter on the RawDataBag and produces a new databag

Args

databag : T
the bag to apply the filter to

Returns

T
the new bag with the filtered content
Expand source code
@abstractmethod
def filter(self, databag: T) -> T:
    """
    implements a simple filter on the RawDataBag and produces a new databag
    Args:
        databag (T): the bag to apply the filter to

    Returns:
        T: the new  bag with the filtered content

    """