Edit page in Livemark
(2024-12-13 12:49)

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)
{'memory': [{'name': isodate.duration.Duration(0, 0, 0, years=1, months=0)}]}

Reference

fields.DurationField (class)

fields.DurationField (class)

Field representation

Signature

(*, 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) -> None

Parameters

  • name (str)
  • title (Optional[str])
  • description (Optional[str])
  • format (str)
  • missing_values (List[str])
  • constraints (Dict[str, Any])
  • rdf_type (Optional[str])
  • example (Optional[str])
  • schema (Optional[Schema])