This document is for Kombu's development version, which can be significantly different from previous releases. Get the stable docs here: 5.0.

Text utilitites - kombu.utils.text

Text Utilities.

kombu.utils.text.escape_regex(p: str, white: str = '') str[source]

Escape string for use within a regular expression.

kombu.utils.text.fmatch_best(needle: str, haystack: Sequence[str], min_ratio: float = 0.6) str[source]

Fuzzy match - Find best match (scalar).

kombu.utils.text.fmatch_iter(needle: str, haystack: Sequence[str], min_ratio: float = 0.6) Iterator[Tuple[float, str]][source]

Fuzzy match: iteratively.

Yields

Tuple – of ratio and key.

kombu.utils.text.version_string_as_tuple(s: str) kombu.version_info_t[source]

Convert version string to version info tuple.