arelle.oim.tc.report.key_values

See COPYRIGHT.md for copyright information.

Module Contents

Classes

KeyValue

A key field value that orders by the value space of its type.

KeyFieldType

Converts the effective values of one key field into key values.

SortTracker

Checks that the key values of consecutive rows of one table strictly increase.

Functions

has_invalid_value

Whether any field literal is outside the value space of its type.

Data

API

class arelle.oim.tc.report.key_values.KeyValue

Bases: typing.NamedTuple

A key field value that orders by the value space of its type.

Ranks put nulls before every typed value and unparseable literals after them. Within the typed rank the value is canonical, so lexical variants are equal.

rank: int

None

value: Any

None

arelle.oim.tc.report.key_values.NULL_KEY_VALUE

‘KeyValue(…)’

arelle.oim.tc.report.key_values.KeyValues

None

class arelle.oim.tc.report.key_values.KeyFieldType(constraint: arelle.oim.tc.metadata.model.TCValueConstraint, namespaces: collections.abc.Mapping[str, str])

Converts the effective values of one key field into key values.

Initialization

key_value(value: str | None) → arelle.oim.tc.report.key_values.KeyValue
arelle.oim.tc.report.key_values.has_invalid_value(key_values: arelle.oim.tc.report.key_values.KeyValues) → bool

Whether any field literal is outside the value space of its type.

class arelle.oim.tc.report.key_values.SortTracker

Checks that the key values of consecutive rows of one table strictly increase.

A table is either sorted or not, so only the first row that breaks the order is reported.

Initialization

add(key: arelle.oim.tc.report.key_values.KeyValues) → bool

Records a row’s key value and returns False for the first row out of order.