fastoad.utils.strings module

Module for string-related operations

exception fastoad.utils.strings.FastCouldNotParseStringToArrayError(parsed_text, original_exception)[source]

Bases: fastoad.exceptions.FastError

Raised when a conversion from string to array failed.

fastoad.utils.strings.get_float_list_from_string(text: str)[source]

Parses the provided string and returns a list of floats if possible.

If provided text is not numeric, None is returned.

New line characters are simply ignored.

As an example, following patterns will result as list [1., 2., 3.]

'[ 1, 2., 3]'
' 1, 2., 3'
' 1 2  3'
' 1 2  3 dummy 4'