pycql.ast¶
-
class
pycql.ast.ArithmeticExpressionNode(lhs, rhs, op)¶ Node class to represent arithmetic operation expressions with two sub-expressions and an operator.
Variables: - lhs – the left hand side node of this arithmetic expression
- rhs – the right hand side node of this arithmetic expression
- op – the comparison type. One of
"+","-","*","/"
-
get_sub_nodes()¶ Get a list of sub-node of this node.
Returns: a list of all sub-nodes Return type: list[Node]
-
get_template()¶ Get a template string (using the
%operator) to represent the current node and sub-nodes. The template string must provide a template replacement for each sub-node reported byget_sub_nodes().Returns: the template to render
-
class
pycql.ast.AttributeExpression(name)¶ Node class to represent attribute lookup expressions
Variables: name – the name of the attribute to be accessed
-
class
pycql.ast.BBoxPredicateNode(lhs, minx, miny, maxx, maxy, crs=None)¶ Node class to represent a bounding box predicate.
Variables: - lhs – the left hand side node of this predicate
- minx – the minimum X value of the bounding box
- miny – the minimum Y value of the bounding box
- maxx – the maximum X value of the bounding box
- maxx – the maximum Y value of the bounding box
- crs – the coordinate reference system identifier for the CRS the BBox is expressed in
-
get_sub_nodes()¶ Get a list of sub-node of this node.
Returns: a list of all sub-nodes Return type: list[Node]
-
get_template()¶ Get a template string (using the
%operator) to represent the current node and sub-nodes. The template string must provide a template replacement for each sub-node reported byget_sub_nodes().Returns: the template to render
-
class
pycql.ast.BetweenPredicateNode(lhs, low, high, not_)¶ Node class to represent a BETWEEN predicate: to check whether an expression value within a range.
Variables: - lhs – the left hand side node of this comparison
- low – the lower bound of the clause
- high – the upper bound of the clause
- not – whether the predicate shall be negated
-
get_sub_nodes()¶ Get a list of sub-node of this node.
Returns: a list of all sub-nodes Return type: list[Node]
-
get_template()¶ Get a template string (using the
%operator) to represent the current node and sub-nodes. The template string must provide a template replacement for each sub-node reported byget_sub_nodes().Returns: the template to render
-
class
pycql.ast.CombinationConditionNode(lhs, rhs, op)¶ Node class to represent a condition to combine two other conditions using either AND or OR.
Variables: - lhs – the left hand side node of this combination
- rhs – the right hand side node of this combination
- op – the combination type. Either
"AND"or"OR"
-
get_sub_nodes()¶ Get a list of sub-node of this node.
Returns: a list of all sub-nodes Return type: list[Node]
-
get_template()¶ Get a template string (using the
%operator) to represent the current node and sub-nodes. The template string must provide a template replacement for each sub-node reported byget_sub_nodes().Returns: the template to render
-
class
pycql.ast.ComparisonPredicateNode(lhs, rhs, op)¶ Node class to represent a comparison predicate: to compare two expressions using a comparison operation.
Variables: - lhs – the left hand side node of this comparison
- rhs – the right hand side node of this comparison
- op – the comparison type. One of
"=","<>","<",">","<=",">="
-
get_sub_nodes()¶ Get a list of sub-node of this node.
Returns: a list of all sub-nodes Return type: list[Node]
-
get_template()¶ Get a template string (using the
%operator) to represent the current node and sub-nodes. The template string must provide a template replacement for each sub-node reported byget_sub_nodes().Returns: the template to render
-
class
pycql.ast.ConditionNode¶ The base class for all nodes representing a condition
-
class
pycql.ast.ExpressionNode¶ The base class for all nodes representing expressions
-
class
pycql.ast.InPredicateNode(lhs, sub_nodes, not_)¶ Node class to represent list checking predicate.
Variables: - lhs – the left hand side node of this predicate
- sub_nodes – the list of sub nodes to check the inclusion against
- not – whether the predicate shall be negated
-
get_sub_nodes()¶ Get a list of sub-node of this node.
Returns: a list of all sub-nodes Return type: list[Node]
-
get_template()¶ Get a template string (using the
%operator) to represent the current node and sub-nodes. The template string must provide a template replacement for each sub-node reported byget_sub_nodes().Returns: the template to render
-
class
pycql.ast.LikePredicateNode(lhs, rhs, case, not_)¶ Node class to represent a wildcard sting matching predicate.
Variables: - lhs – the left hand side node of this predicate
- rhs – the right hand side node of this predicate
- case – whether the comparison shall be case sensitive
- not – whether the predicate shall be negated
-
get_sub_nodes()¶ Get a list of sub-node of this node.
Returns: a list of all sub-nodes Return type: list[Node]
-
get_template()¶ Get a template string (using the
%operator) to represent the current node and sub-nodes. The template string must provide a template replacement for each sub-node reported byget_sub_nodes().Returns: the template to render
-
class
pycql.ast.LiteralExpression(value)¶ Node class to represent literal value expressions
Variables: value – the value of the literal
-
class
pycql.ast.Node¶ The base class for all other nodes to display the AST of CQL.
-
get_sub_nodes()¶ Get a list of sub-node of this node.
Returns: a list of all sub-nodes Return type: list[Node]
-
get_template()¶ Get a template string (using the
%operator) to represent the current node and sub-nodes. The template string must provide a template replacement for each sub-node reported byget_sub_nodes().Returns: the template to render
-
-
class
pycql.ast.NotConditionNode(sub_node)¶ Node class to represent a negation condition.
Variables: sub_node – the condition node to be negated -
get_sub_nodes()¶ Returns the sub-node for the negated condition.
-
get_template()¶ Get a template string (using the
%operator) to represent the current node and sub-nodes. The template string must provide a template replacement for each sub-node reported byget_sub_nodes().Returns: the template to render
-
-
class
pycql.ast.NullPredicateNode(lhs, not_)¶ Node class to represent null check predicate.
Variables: - lhs – the left hand side node of this predicate
- not – whether the predicate shall be negated
-
get_sub_nodes()¶ Get a list of sub-node of this node.
Returns: a list of all sub-nodes Return type: list[Node]
-
get_template()¶ Get a template string (using the
%operator) to represent the current node and sub-nodes. The template string must provide a template replacement for each sub-node reported byget_sub_nodes().Returns: the template to render
-
class
pycql.ast.PredicateNode¶ The base class for all nodes representing a predicate
-
class
pycql.ast.SpatialPredicateNode(lhs, rhs, op, pattern=None, distance=None, units=None)¶ Node class to represent spatial relation predicate.
Variables: - lhs – the left hand side node of this comparison
- rhs – the right hand side node of this comparison
- op – the comparison type. One of
"INTERSECTS","DISJOINT","CONTAINS","WITHIN","TOUCHES","CROSSES","OVERLAPS","EQUALS","RELATE","DWITHIN","BEYOND" - pattern – the relationship patter for the
"RELATE"operation - distance – the distance for distance related operations
- units – the units for distance related operations
-
get_sub_nodes()¶ Get a list of sub-node of this node.
Returns: a list of all sub-nodes Return type: list[Node]
-
get_template()¶ Get a template string (using the
%operator) to represent the current node and sub-nodes. The template string must provide a template replacement for each sub-node reported byget_sub_nodes().Returns: the template to render
-
class
pycql.ast.TemporalPredicateNode(lhs, rhs, op)¶ Node class to represent temporal predicate.
Variables: - lhs – the left hand side node of this comparison
- rhs – the right hand side node of this comparison
- op – the comparison type. One of
"BEFORE","BEFORE OR DURING","DURING","DURING OR AFTER","AFTER"
-
get_sub_nodes()¶ Get a list of sub-node of this node.
Returns: a list of all sub-nodes Return type: list[Node]
-
get_template()¶ Get a template string (using the
%operator) to represent the current node and sub-nodes. The template string must provide a template replacement for each sub-node reported byget_sub_nodes().Returns: the template to render
-
pycql.ast.get_repr(node, indent_amount=0, indent_incr=4)¶ Get a debug representation of the given AST node.
indent_amountandindent_incrare for the recursive call and don’t need to be passed.Parameters: Returns: the represenation of the node
Return type: