Edit page in Livemark
(2023-01-25 11:55)

Duration Field

Overview

A duration of time. We follow the definition of XML Schema duration datatype directly and that definition is implicitly inlined here. Read more in Table Schema Standard.

Example

from frictionless import Schema, extract, fields

data = [['name'], ['P1Y']]
rows = extract(data, schema=Schema(fields=[fields.DurationField(name='name')]))
print(rows)
[{'name': isodate.duration.Duration(0, 0, 0, years=1, months=0)}]

Reference

fields.DurationField (class)

fields.DurationField (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) -> 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])

fields.durationField.type (property)

Signature

ClassVar[str]

fields.durationField.builtin (property)

Signature

ClassVar[bool]

fields.durationField.supported_constraints (property)

Signature

ClassVar[List[str]]

fields.durationField.name (property)

Signature

Optional[str]

fields.durationField.title (property)

Signature

Optional[str]

fields.durationField.description (property)

Signature

Optional[str]

fields.durationField.format (property)

Signature

str

fields.durationField.missing_values (property)

Signature

List[str]

fields.durationField.constraints (property)

Signature

dict

fields.durationField.rdf_type (property)

Signature

Optional[str]

fields.durationField.example (property)

Signature

Optional[str]

fields.durationField.schema (property)

Signature

Optional[Schema]