mmeutils.text package

Module contents

Text Processing Utility Functions

mmeutils.text.strip_discard_empty_lines(lines: Iterable[str] | TextIOWrapper) List[str]

Sanitizes string lines in an iterable such that:

  • Leading and trailing whitespace is discarded (“strip()”)

  • Empty lines (including whitespace-only) are discarded

Parameters:

lines (Iterable[str]) – An iterable of string lines to process

Returns:

The list of normalized (non-empty) strings.

Return type:

List[str]