beta.xbrl.xule

The beta.xbrl.xule module provides an API for the XULE language. The API allows rules written in XULE to parsed and executed.

Classes

Functions

beta.xbrl.xule.compile(ruleset, *, catalog=None, **kargs)

Returns a beta.xbrl.xule.RuleSet object that represents the compiled rule set in the given XULE source code. Argument ruleset can be either a XULE source string or buffer. A beta.xbrl.xule.:obj:`ParseError` exception is raised if a syntax error is encountered during parsing.

beta.xbrl.xule.execute(ruleset, *, Instance instance=None, Session session=None, catalog=None, rules_to_process=None, stack_size=None, use_namespaces_from_instance=None, **kargs)

Executes the given XULE source code and returns a list of beta.xbrl.xule.Result objects that represent the assertion and output rule results. Argument ruleset can be either a XULE source string or buffer or beta.xbrl.RuleSet and beta.xbrl.RuleSetMap objects. The default XULE session is used if no session is explicitly specified. Raises a beta.xbrl.xule.:obj:`ParseError` or beta.xbrl.xule.:obj:`RuntimeError` exception when an error is encountered during compilation or execution.

beta.xbrl.xule.execute_expression(expr, *, Instance instance=None, Session session=None, catalog=None, stack_size=None, use_namespaces_from_instance=True, **kargs)

Executes a simple XULE expression and returns a list of beta.xbrl.xule.Result objects that represent the assertion and output rule results. The default XULE session is used if no session is explicitly specified. Raises a beta.xbrl.xule.:obj:`ParseError` or beta.xbrl.xule.:obj:`RuntimeError` exception when an error is encountered during compilation or execution.

Enum Classes

class beta.xbrl.xule.AssertionSatisfiedType

The beta.xbrl.taxonomy.AssertionSatisfiedType enumeration represents the type of an XULE assertion.

SATISFIED The assertion is triggered when the rule condition evaluates to true UNSATISFIED The assertion is triggered when the rule condition evaluates to false

class beta.xbrl.xule.ExpressionType

The beta.xbrl.taxonomy.ExpressionType enumeration represents the types of expressions in a XULE parse tree.

ADDEXPR ADDEXPR ANDEXPR ANDEXPR ASPECTFILTER ASPECTFILTER ASPECTNAME ASPECTNAME BALANCE BALANCE BALANCE BALANCE BASESTRING BASESTRING BLOCKEXPR BLOCKEXPR BOOLEAN BOOLEAN COMPEXPR COMPEXPR CONSTANTDECLARATION CONSTANTDECLARATION DICTEXPR DICTEXPR ELSEIF ELSEIF ESCAPE ESCAPE FACTSET FACTSET FILTER FILTER FLOAT FLOAT FOREXPR FOREXPR FUNCTIONARG FUNCTIONARG FUNCTIONDECLARATION FUNCTIONDECLARATION FUNCTIONREFERENCE FUNCTIONREFERENCE IFEXPR IFEXPR INEXPR INEXPR INDEXEXPR INDEXEXPR INTEGER INTEGER INTERSECTEXPR INTERSECTEXPR ITEM ITEM LISTEXPR LISTEXPR MULTEXPR MULTEXPR NAVIGATION NAVIGATION NONE NONE NOTEXPR NOTEXPR NAMESPACEDECLARATION NAMESPACEDECLARATION OREXPR OREXPR OUTPUTATTRIBUTE OUTPUTATTRIBUTE OUTPUTRULE OUTPUTRULE PERIOD PERIOD PERIODTYPE PERIODTYPE PROPERTY PROPERTY PROPERTYEXPR PROPERTYEXPR QNAME QNAME OUTPUTATTRIBUTEDECLARATION OUTPUTATTRIBUTEDECLARATION RETURNEXPR RETURNEXPR RIGHTOPERATION RIGHTOPERATION RULENAMEPREFIX RULENAMEPREFIX RULENAMESEPARATOR RULENAMESEPARATOR SETEXPR SETEXPR SEVERITY SEVERITY STRING STRING SYMMETRICDIFFERENCEEXPR SYMMETRICDIFFERENCEEXPR TAGGEDEXPR TAGGEDEXPR TAGREF TAGREF VARDECLARATION VARDECLARATION VARREF VARREF VERSIONDECLARATION VERSIONDECLARATION UNARYEXPR UNARYEXPR

class beta.xbrl.xule.Severity

The beta.xbrl.xule.Severity enumeration represents the severity of a XULE assertion.

Severity.ERROR

ERROR

Severity.OK

OK

Severity.WARNING

WARNING