Selector classes
Single select
- class form_analyzer.selectors.SingleSelect(selections: List[str], filter_: Filter, alternative: Optional[Union[TextField, TextFieldWithCheckbox]] = None, additional: Optional[Union[TextField, TextFieldWithCheckbox]] = None)
This selector handles single-select fields in a form.
It requires a list of selections where one can be selected. The selected field will be represented as its value in the resulting Excel column.
It is possible to indicate an alternative selector that will be used if no selection was found (i.e. to give a free text).
- Parameters
selections – List of possible selections
filter – Filter
alternative – Alternative text field that is used when no selection was found
additional – Additional text field whose content is always added to the result
Multi select
- class form_analyzer.selectors.MultiSelect(selections: List[str], filter_: Filter, alternative: Optional[Union[TextField, TextFieldWithCheckbox]] = None, additional: Optional[Union[TextField, TextFieldWithCheckbox]] = None)
This selector handles multi-select fields in a form.
It requires a list of selections where none or several can be selected. Each selected field will be represented by a “1” in the resulting Excel column.
It is possible to indicate an alternative selector that will be used if no selection was found (i.e. to give a free text).
- Parameters
selections – List of possible selections
filter – Filter
alternative – Alternative text field that is used when no selection was found
additional – Additional text field whose content is always added to the result
Text field
Text field with checkbox
- class form_analyzer.selectors.TextFieldWithCheckbox(label: str, filter_: Filter, separator: str = ':')
Text field with an additional checkbox.
The indicated text is always returned, if it shall only be done when the checkbox is selected, use the Selected filter.
- Parameters
label – Label of the text field
filter – Filter
separator – Separator between the checkbox with label and the free text, default ‘:’
Number
- class form_analyzer.selectors.Number(label: str, filter_: Filter, min_digits: int = 0, max_digits: int = 100)
Number field which is identified by a field label.
To check the validity of a number, the minimum and maximum number of digits can be indicated.
- Parameters
label – Number field label
filter – Filter
min_digits – Minimum number of digits, set to 0 to ignore, default is 0
max_digits – Maximum number of digits, set to 0 to ignore, default is 0
Placeholder
- class form_analyzer.selectors.Placeholder
Placeholder selector
This selector will appear as an empty column in the Excel sheet.