arelle.utils.validate.Facts

See COPYRIGHT.md for copyright information.

Module Contents

Functions

factHasXsiNilAttribute

Returns True if the fact has the xsi:nil attribute set (regardless of value).

factHasPrecisionAttribute

Returns True if the fact has the precision attribute explicitly set. Checks the raw attribute value, not the effective precision from type defaults.

isEmptyStringItemFact

Returns True if the fact is a string item type concept with an empty value.

isValidNonNilFact

Returns True if fact is valid (xValid >= VALID) and non-nil.

factHasNegativeNumericValue

Returns True if fact is valid and has a negative numeric value.

getDuplicateFactGroupsByConceptContextUnit

Groups facts by their concept/context/unit hash. Returns a mapping of hash to list of facts. Used by validation rules that detect duplicate facts based on concept, context, and unit.

iterValidNonNilFactsByQname

Yields facts with the given QName that are valid and non-nil.

hasValidNonNilFactByQname

Returns True if at least one valid, non-nil fact exists for the given QName.

getUsedConceptsFromFacts

Returns the set of concepts used on facts in the instance.

hasNonNillFact

Returns True if a fact with the given concept key is tagged with a non-nil, valid value. conceptKey is QName or str (localName).

getNegativeFacts

Returns the list of facts with the given concept key that have a negative value. conceptKey is QName when byQname=True, else str (localName).

Data

API

arelle.utils.validate.Facts.XSI_NIL_ATTR

‘{http://www.w3.org/2001/XMLSchema-instance}nil’

arelle.utils.validate.Facts.factHasXsiNilAttribute(fact: arelle.ModelInstanceObject.ModelFact) bool

Returns True if the fact has the xsi:nil attribute set (regardless of value).

arelle.utils.validate.Facts.factHasPrecisionAttribute(fact: arelle.ModelInstanceObject.ModelFact) bool

Returns True if the fact has the precision attribute explicitly set. Checks the raw attribute value, not the effective precision from type defaults.

arelle.utils.validate.Facts.isEmptyStringItemFact(fact: arelle.ModelInstanceObject.ModelFact) bool

Returns True if the fact is a string item type concept with an empty value.

arelle.utils.validate.Facts.isValidNonNilFact(fact: arelle.ModelInstanceObject.ModelFact) bool

Returns True if fact is valid (xValid >= VALID) and non-nil.

arelle.utils.validate.Facts.factHasNegativeNumericValue(fact: arelle.ModelInstanceObject.ModelFact) bool

Returns True if fact is valid and has a negative numeric value.

arelle.utils.validate.Facts.getDuplicateFactGroupsByConceptContextUnit(facts: collections.abc.Iterable[arelle.ModelInstanceObject.ModelFact]) dict[object, list[arelle.ModelInstanceObject.ModelFact]]

Groups facts by their concept/context/unit hash. Returns a mapping of hash to list of facts. Used by validation rules that detect duplicate facts based on concept, context, and unit.

arelle.utils.validate.Facts.iterValidNonNilFactsByQname(modelXbrl: arelle.ModelXbrl.ModelXbrl, qname: arelle.ModelValue.QName) collections.abc.Iterable[arelle.ModelInstanceObject.ModelFact]

Yields facts with the given QName that are valid and non-nil.

arelle.utils.validate.Facts.hasValidNonNilFactByQname(modelXbrl: arelle.ModelXbrl.ModelXbrl, qname: arelle.ModelValue.QName) bool

Returns True if at least one valid, non-nil fact exists for the given QName.

arelle.utils.validate.Facts.getUsedConceptsFromFacts(modelXbrl: arelle.ModelXbrl.ModelXbrl) set[arelle.ModelDtsObject.ModelConcept]

Returns the set of concepts used on facts in the instance.

arelle.utils.validate.Facts.hasNonNillFact(modelXbrl: arelle.ModelXbrl.ModelXbrl, conceptKey: Union[arelle.ModelValue.QName, str]) bool

Returns True if a fact with the given concept key is tagged with a non-nil, valid value. conceptKey is QName or str (localName).

arelle.utils.validate.Facts.getNegativeFacts(modelXbrl: arelle.ModelXbrl.ModelXbrl, conceptKey: Union[arelle.ModelValue.QName, str]) list[arelle.ModelInstanceObject.ModelFact]

Returns the list of facts with the given concept key that have a negative value. conceptKey is QName when byQname=True, else str (localName).