weblib.text

Text parsing and processing utilities.

weblib.text.drop_space(text)[source]

Drop all space-chars in the text.

weblib.text.find_number(text, ignore_spaces=False, make_int=True, ignore_chars=None)[source]

Find the number in the text.

Parameters:
  • text – unicode or byte-string text
  • ignore_spaces – if True then groups of digits delimited by spaces are considered as one number
Raises:

DataNotFound if number was not found.

weblib.text.normalize_space(text, replace=' ')[source]

Replace sequence of space-chars with one space char.

Also drop leading and trailing space-chars.

weblib.text.remove_bom(text)[source]

Remove BOM-sequence from the start of byte string.