xbrl.FactSet

A xbrl.FactSet class represents a set of XBRL facts in an instance.

class xbrl.FactSet(facts=None)

Constructs a new xbrl.FactSet object. If no arguments are given, a new empty fact set is constructed. If facts is of type xbrl.FactSet, a copy of the given fact set is constructed. Otherwise facts must be an iterable of xbrl.Fact or xbrl.FactSet objects and a new fact set containing those facts will be constructed.

Class methods

classmethod xbrl.FactSet.from_intersection(type cls, *factsets)

Returns a new xbrl.FactSet object containing the intersection of the xbrl.FactSet arguments.

classmethod xbrl.FactSet.from_union(type cls, *factsets)

Returns a new xbrl.FactSet object containing the union of the xbrl.FactSet arguments.

Attributes

xbrl.FactSet.instance

Returns an xbrl.Instance object that contains the facts in this fact set or None if this fact set is empty.

xbrl.FactSet.is_duplicate_set

Returns True if this fact set is a duplicate fact set containing only facts that are duplicates of each other. Duplicate fact sets can be created using the xbrl.FactSet.duplicate_sets() method.

Methods

xbrl.FactSet.add(Fact fact)

Adds the given fact to this fact set.

xbrl.FactSet.clear()

Removes all facts from this fact set.

xbrl.FactSet.concept_aspect_values()

Returns an iterator of xbrl.ConceptAspectValue objects for each distinct concept aspect value present among the facts in this fact set.

xbrl.FactSet.copy()

Returns an xbrl.FactSet object which is an independent copy of the current fact set.

xbrl.FactSet.difference(FactSet other, *args)

Returns a new fact set containing the result of the set difference between this and the other fact sets.

xbrl.FactSet.difference_update(FactSet other, *args)

Modifies this fact set to contain the result of the set difference between this and the other fact sets.

xbrl.FactSet.dimension_aspect_values(Dimension dimension, include_unreported=False)

Returns an iterator of xbrl.ExplicitDimensionAspectValue or xbrl.TypedDimensionAspectValue objects for each distinct dimension aspect value for the given dimension present among the facts in this fact set. If include_unreported is set to False, the absent value for the given dimension aspect will not be included.

xbrl.FactSet.discard(Fact fact)

Removes the given fact from this fact set. Never raises a KeyError exception.

xbrl.FactSet.duplicate_sets()

Returns an iterator of xbrl.DuplicateFactSet objects for each set of duplicate facts.

xbrl.FactSet.entity_identifier_aspect_values()

Returns an iterator of xbrl.EntityIdentifierAspectValue objects for each distinct entity identifier aspect value present among the facts in this fact set.

xbrl.FactSet.filter(*constraints, **kargs)

Returns a new xbrl.FactSet object which represents the subset of XBRL facts in this fact set that fulfill the given constraints. If constraint is of type xml.QName or xbrl.taxonomy.Concept, then only facts for this concept are returned. If constraint is of type xbrl.Context, then only facts reported with this context are returned. If constraint is of type xbrl.Unit, then only facts reported with this unit are returned. If constraint is an aspect value (xbrl.ConceptAspectValue, xbrl.LocationAspectValue, xbrl.EntityIdentifierAspectValue, xbrl.PeriodAspectValue, xbrl.SegmentAspectValue, xbrl.ScenarioAspectValue, xbrl.UnitAspectValue, xbrl.ExplicitDimensionAspectValue, xbrl.TypedDimensionAspectValue), then only facts with an equivalent aspect value are returned. If constraint is of type xbrl.ConstraintSet, then only facts that have matching aspect values for the aspects in the given constraint set are returned. If constraint is of type xbrl.ConstraintSet, set allow_additional_dimensions to False to retrieve only facts that have exactly the same set of dimension apsects as specified in the given constraint set. Set allow_nil to False to retrieve only non-nill facts.

xbrl.FactSet.filter_duplicates(classes=DuplicateClass.ALL)

Returns a new xbrl.FactSet object after removing any duplicate facts in the given classes.

xbrl.FactSet.filter_update(*constraints, **kargs)

Removes any facts from this fact set that don’t fulfill the given constraints. If constraint is of type xml.QName or xbrl.taxonomy.Concept, then only facts for this concept are retained. If constraint is of type xbrl.Context, then only facts reported with this context are retained. If constraint is of type xbrl.Unit, then only facts reported with this unit are retained. If constraint is an aspect value (xbrl.ConceptAspectValue, xbrl.LocationAspectValue, xbrl.EntityIdentifierAspectValue, xbrl.PeriodAspectValue, xbrl.SegmentAspectValue, xbrl.ScenarioAspectValue, xbrl.UnitAspectValue, xbrl.ExplicitDimensionAspectValue, xbrl.TypedDimensionAspectValue), then only facts with an equivalent aspect value are retained. If constraint is of type xbrl.ConstraintSet, then only facts that have matching aspect values for the aspects in the given constraint set are retained. If constraint is of type xbrl.ConstraintSet, set allow_additional_dimensions to False to retained only facts that have exactly the same set of dimension apsects as specified in the given constraint set. Set allow_nil to False to retain only non-nill facts.

xbrl.FactSet.has_duplicates(classes=DuplicateClass.ALL)

Returns True if this fact set contains duplicate facts of the given classes.

xbrl.FactSet.intersection(FactSet other, *args)

Returns a new fact set containing the result of the set intersection of this and the other fact sets.

xbrl.FactSet.intersection_update(FactSet other, *args)

Modifies this fact set to contain the result of the set intersection of this and the other fact sets.

xbrl.FactSet.isdisjoint(FactSet other)

Returns True if the other fact set has no common facts with this fact set.

xbrl.FactSet.issubset(FactSet other)

Returns True if all facts of this fact set are also present in the other fact set.

xbrl.FactSet.issuperset(FactSet other)

Returns True if all facts of the other fact set are also present in this fact set.

xbrl.FactSet.non_xdt_scenario_aspect_values()

Returns an iterator of xbrl.ScenarioAspectValue objects for each distinct non-XDT scenario aspect value present among the facts in this fact set.

xbrl.FactSet.non_xdt_segment_aspect_values()

Returns an iterator of xbrl.SegmentAspectValue objects for each distinct non-XDT segment aspect value present among the facts in this fact set.

xbrl.FactSet.period_aspect_values()

Returns an iterator of xbrl.PeriodAspectValue objects for each distinct period aspect value present among the facts in this fact set.

xbrl.FactSet.pop()

Removes and returns a fact from this fact set. If the fact set is empty, a KeyError exception is raised.

xbrl.FactSet.remove(Fact fact)

Removes the given fact from this fact set. If this fact set doesn’t contain the given fact, a KeyError exception is raised.

xbrl.FactSet.symmetric_difference(FactSet other)

Returns a new fact set containing the result of the set symmetric difference between this and the other fact set.

xbrl.FactSet.symmetric_difference_update(FactSet other)

Modifies this fact set to contain the result of the set symmetric difference between this and the other fact sets.

xbrl.FactSet.union(FactSet other, *args)

Returns a new fact set containing the result of the set union of this and the other fact sets.

xbrl.FactSet.unit_aspect_values()

Returns an iterator of xbrl.UnitAspectValue objects for each distinct unit aspect value present among the facts in this fact set.

xbrl.FactSet.update(FactSet other, *args)

Modifies this fact set to contain the result of the set union of this and the other fact sets.

Special methods

__and__, __contains__, __delitem__, __eq__, __ge__, __getitem__, __gt__, __iand__, __ior__, __isub__, __iter__, __ixor__, __le__, __len__, __lt__, __ne__, __or__, __rand__, __ror__, __rsub__, __rxor__, __setitem__, __sub__, __xor__