The field contains boolean (true/false) data.
In the physical representations of data where boolean values are represented with strings, the values set in trueValues and falseValues are to be cast to their logical representation as booleans. trueValues and falseValues are arrays which can be customised to user need. The default values for these are in the additional properties section below. Read more in Table Schema Standard.
from frictionless import Schema, extract, fields
data = [['name'], ['true'], ['false']]
rows = extract(data, schema=Schema(fields=[fields.BooleanField(name='name')]))
print(rows)
{'memory': [{'name': True}, {'name': False}]}
Field representation
(*, name: str, title: Optional[str] = None, description: Optional[str] = None, format: str = default, missing_values: List[str] = NOTHING, constraints: Dict[str, Any] = NOTHING, rdf_type: Optional[str] = None, example: Optional[str] = None, schema: Optional[Schema] = None, true_values: List[str] = NOTHING, false_values: List[str] = NOTHING) -> None
It defines the values to be read as true values while reading data. The default true values are ["true", "True", "TRUE", "1"].
List[str]
It defines the values to be read as false values while reading data. The default true values are ["false", "False", "FALSE", "0"].
List[str]