xbrl.FactSet¶
A xbrl.FactSet class represents a set of XBRL facts in an instance.
-
class
xbrl.FactSet(facts=None)¶ Constructs a new
xbrl.FactSetobject. If no arguments are given, a new empty fact set is constructed. If facts is of typexbrl.FactSet, a copy of the given fact set is constructed. Otherwise facts must be an iterable ofxbrl.Factorxbrl.FactSetobjects 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.FactSetobject containing the intersection of thexbrl.FactSetarguments.
-
classmethod
xbrl.FactSet.from_union(type cls, *factsets)¶ Returns a new
xbrl.FactSetobject containing the union of thexbrl.FactSetarguments.
Attributes¶
-
xbrl.FactSet.instance¶ Returns an
xbrl.Instanceobject 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.ConceptAspectValueobjects for each distinct concept aspect value present among the facts in this fact set.
-
xbrl.FactSet.copy()¶ Returns an
xbrl.FactSetobject 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.ExplicitDimensionAspectValueorxbrl.TypedDimensionAspectValueobjects 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
KeyErrorexception.
-
xbrl.FactSet.duplicate_sets()¶ Returns an iterator of
xbrl.DuplicateFactSetobjects for each set of duplicate facts.
-
xbrl.FactSet.entity_identifier_aspect_values()¶ Returns an iterator of
xbrl.EntityIdentifierAspectValueobjects for each distinct entity identifier aspect value present among the facts in this fact set.
-
xbrl.FactSet.filter(*constraints, **kargs)¶ Returns a new
xbrl.FactSetobject which represents the subset of XBRL facts in this fact set that fulfill the given constraints. If constraint is of typexml.QNameorxbrl.taxonomy.Concept, then only facts for this concept are returned. If constraint is of typexbrl.Context, then only facts reported with this context are returned. If constraint is of typexbrl.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 typexbrl.ConstraintSet, then only facts that have matching aspect values for the aspects in the given constraint set are returned. If constraint is of typexbrl.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.FactSetobject 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.QNameorxbrl.taxonomy.Concept, then only facts for this concept are retained. If constraint is of typexbrl.Context, then only facts reported with this context are retained. If constraint is of typexbrl.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 typexbrl.ConstraintSet, then only facts that have matching aspect values for the aspects in the given constraint set are retained. If constraint is of typexbrl.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.ScenarioAspectValueobjects 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.SegmentAspectValueobjects 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.PeriodAspectValueobjects 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
KeyErrorexception 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
KeyErrorexception 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.UnitAspectValueobjects 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__