FieldPattern¶
-
class
fuzzytable.FieldPattern(name, alias=None, approximate_match: Optional[bool] = None, min_ratio: Optional[float] = sentinel.DefaultValue, contains_match: [<class 'bool'>] = False, multifield: [<class 'bool'>] = False, cellpattern=None, mode=sentinel.DefaultValue, searchterms_excludename=False, case_sensitive=sentinel.DefaultValue)¶ Optional argument for
FuzzyTable subfieldsparameter.FieldPattern arguments override FuzzyTable arguments of the same name. In the following example, the
first_nameFieldPattern uses approximate matching whilelast_nameuses exact matching.>>> from fuzzytable import FuzzyTable >>> subfields = [ ... FieldPattern('first_name', approximate_match=False), ... FieldPattern('last_name') ... ] >>> FuzzyTable(approximate_match=True, subfields=subfields)
Parameters: - name (
str) – SingleField name. This is the name that will given to a matched field. This parameter, along with any aliases supplied, are the search criteria. - alias (
stroriterablethereof, defaultNone) – Additional search criteria. - approximate_match (
bool, defaultNone) – Overrides the default behavior of theFuzzyTableapproximate_matchparameter. Deprecated in v0.18. To be removed in v1.0. Usemodeinstead. - min_ratio (
float, defaultNone) – Overrides the default behavior of theFuzzyTablemin_ratioparameter. - contains_match (
bool, defaultFalse) – Overrides the standard ratio-based approximate matching. Instead, a match succeeds if any of this field’s terms are contained in a cell string. Deprecated in v0.18. To be removed in v1.0. Usemodeinstead. - multifield (
bool, defaultFalse) – - cellpattern (
CellPatternor any callable) – This normalizes this field’s data. - mode (None or
str) – Choose from'exact','approx', or'contains'.modeoverrides approximate_match and contains_match. - searchterms_excludename (
bool, defaultFalse) – If True, the FieldPattern name is not used as a search term; only aliases are used. This means a FieldPattern with searchterms_excludename and no aliases will produce no matches! - case_sensitive (None or
bool, defaultTrue) – Used when seeking header row and matching Fields to FieldPatterns.
- name (