xbrl.formula

The xbrl.formula module provides a Python API for the Formula 1.0 specifications. This Python interface enables the user to navigate the formula linkbase and access information from the formula-related resources.

Classes

Enum Classes

class xbrl.formula.AspectModel

The xbrl.formula.AspectModel enumeration is used to represent the aspectModel attribute on <variable:variableSet> resources.

AspectModel.DIMENSIONAL

Denotes that the variable set is using a dimensional aspect set.

AspectModel.NON_DIMENSIONAL

Denotes that the variable set is using a non-dimensional aspect set.

AspectModel.OTHER

Denotes that the variable set is using an unknown aspect set.

class xbrl.formula.AxisType

The xbrl.formula.AxisType enumeration defines the tree walk direction. See here for more details.

AxisType.ANCESTOR

The tree walk should include all ancestor nodes of the source node up to specified number of generations.

AxisType.ANCESTOR_OR_SELF

The tree walk should include the source node itself and all ancestor nodes up to specified number of generations.

AxisType.CHILD

The tree walk should include all child nodes of the source node.

AxisType.CHILD_OR_SELF

The tree walk should include the source node itself and all its child nodes.

AxisType.DESCENDANT

The tree walk should include all descendant nodes of the source node up to specified number of generations.

AxisType.DESCENDANT_OR_SELF

The tree walk should include the source node itself and all descendant nodes up to specified number of generations.

AxisType.PARENT

The tree walk should include the parent node of the source node.

AxisType.PARENT_OR_SELF

The tree walk should include the source node itself and its parent node.

AxisType.SIBLING

The tree walk should include all sibling nodes of the source node.

AxisType.SIBLING_OR_DESCENDANT

The tree walk should include all sibling and descendant nodes of the source node.

AxisType.SIBLING_OR_DESCENDANT_OR_SELF

The tree walk should include the source node itself and all sibling and descendant nodes of the source node.

AxisType.SIBLING_OR_SELF

The tree walk should include the source node itself and all its sibling nodes.

class xbrl.formula.Boundary

The xbrl.formula.Boundary enumeration is used to represent the boundary attribute on <pf:instantDurationFilter> filter resources.

Boundary.END

Matches the end date of the duration period.

Boundary.START

Matches the start date of the duration period.

class xbrl.formula.OCCType

The xbrl.formula.OCCType enumeration represents the type of the OCC rule.

OCCType.SCENARIO

The OCC rule is a scenario OCC rule.

OCCType.SEGMENT

The OCC rule is a segment OCC rule.

class xbrl.formula.PeriodRuleType

The xbrl.formula.PeriodRuleType enumeration determines how the RAV for the period rule is the calculated. See here for more details.

PeriodRuleType.DURATION

The RAV is a duration period determined by evaluating the XPath expressions on the <formula:duration> element.

PeriodRuleType.FOREVER

The RAV is a forever period.

PeriodRuleType.INSTANT

The RAV is an instant period determined by evaluating the XPath expression on the <formula:instant> element.

PeriodRuleType.SOURCE

The RAV is determined from the SAV.

class xbrl.formula.SeverityLevel

The xbrl.formula.SeverityLevel enumeration represents the value of the ‘level’ attribute on an <sev:severity> resource. See here for more details.

SeverityLevel.ERROR

An error will be reported for each unsatisified assertion evaluation.

SeverityLevel.OK

Unsatisified assertion evaluations will be ignored.

SeverityLevel.WARNING

A warning will be reported for each unsatisified assertion evaluation.