pypaginate.text.normalize

Text normalization for search and filtering.

Delegates the actual normalization (NFKD accent-strip + case-fold + whitespace collapse) to the native pypaginate._core engine, so Python and Rust agree byte-for-byte. A bounded dict cache avoids the FFI hop for repeated field values (which are common across rows).

Functions

clear_normalize_cache(→ None)

Clear the normalize_text cache.

normalize_text(→ str)

Normalize text for search and filtering (native), with a bounded cache.

Module Contents

pypaginate.text.normalize.clear_normalize_cache() None

Clear the normalize_text cache.

Call in long-lived processes or between test runs to free memory from cached normalization results.

pypaginate.text.normalize.normalize_text(value: str) str

Normalize text for search and filtering (native), with a bounded cache.

Parameters:

value – Text to normalize.

Returns:

Normalized ASCII-safe text.