Edit page in Livemark
(2022-09-19 18:33)

Boolean Field

Overview

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.

Example

from frictionless import Schema, extract, fields

data = [['name'], ['true'], ['false']]
rows = extract(data, schema=Schema(fields=[fields.BooleanField(name='name')]))
print(rows)
[{'name': True}, {'name': False}]

Reference

fields.BooleanField (class)

fields.BooleanField (class)

Field representation

Signature

(*, name: Optional[str] = None, title: Optional[str] = None, description: Optional[str] = None, format: str = default, missing_values: List[str] = NOTHING, constraints: dict = 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

Parameters

  • name (Optional[str])
  • title (Optional[str])
  • description (Optional[str])
  • format (str)
  • missing_values (List[str])
  • constraints (dict)
  • rdf_type (Optional[str])
  • example (Optional[str])
  • schema (Optional[Schema])
  • true_values (List[str])
  • false_values (List[str])

fields.booleanField.true_values (property)

NOTE: add docs

Signature

List[str]

fields.booleanField.false_values (property)

NOTE: add docs

Signature

List[str]

It's a beta version of Frictionless Framework (v5). Read Frictionless Framework (v4) docs for a version that is currently installed by default by pip.