comect.sidecar.typing module

Typing module to help keep things clean.

comect.sidecar.typing.FilterType = typing.Union[comect.sidecar.filters.base.Filter, typing.Callable[[str, pathlib.Path], bool]]

A type representing a filter - can be a comect.sidecar.filters.Filter object, or a generic callable that takes a string (the line of text) and a path object (to the logfile), and returns a boolean representing whether the line should be processed.

comect.sidecar.typing.ParserType = typing.Tuple[typing.Union[comect.sidecar.parsers.base.Parser, typing.Callable[[str, pathlib.Path], typing.Union[typing.Any, NoneType]]]]

A type representing a group of filters - this should be a tuple containing one or more comect.sidecar.parsers.Parser objects, generic callable that take a string (the line of text) and a path object (to the logfile) and return an object representing the parsed data, or a mix of both.

comect.sidecar.typing.Pipeline = typing.Tuple[typing.Union[comect.sidecar.filters.base.Filter, typing.Callable[[str, pathlib.Path], bool]], typing.Tuple[typing.Union[comect.sidecar.parsers.base.Parser, typing.Callable[[str, pathlib.Path], typing.Union[typing.Any, NoneType]]]], typing.Union[comect.sidecar.processors.base.Processor, typing.Callable[[str, typing.Any, pathlib.Path], NoneType]]]

A type representing a pipeline - a tuple containing a FilterType, a ParserType, and a ProcessorType.

comect.sidecar.typing.ProcessorType = typing.Union[comect.sidecar.processors.base.Processor, typing.Callable[[str, typing.Any, pathlib.Path], NoneType]]

A type representing a processor - can be a comect.sidecar.processors.Processor object, or a generic callable that takes a string (the line of text), an object (the parsed data) and a path object (to the logfile).