Node Label#
This module defines classes for addressing nodes.
- _get_current_flow_name(ctx)[source]#
Get flow name of the current node from context.
- Return type:
str
- class NodeLabel(**data)[source]#
Bases:
BaseModel
A label for a node. (a way to address a specific node in the script)
Can be relative if
flow_name
isNone
: suchNodeLabel
will reference a node with the namenode_name
in the current flow.- flow_name: Optional[str]#
Name of the flow in the script. Can be
None
in which case this is inherited from theContext.current_node
.
- node_name: str#
Name of the node in the flow.
- NodeLabelInitTypes#
Types that
NodeLabel
can be validated from.alias of
Union
[NodeLabel
, typing.Annotated[str, “node_name, flow name equal to current flow’s name”],Tuple
[typing.Annotated[str, ‘flow_name’], typing.Annotated[str, ‘node_name’]],List
[str
][List
[str
]], typing.Annotated[dict, ‘dict following the NodeLabel data model’]]
- class AbsoluteNodeLabel(**data)[source]#
Bases:
NodeLabel
A label for a node. (a way to address a specific node in the script)
- flow_name: str#
Name of the flow in the script.
- node_name: str#
Name of the node in the flow.
- classmethod validate_from_node_label(data, info)[source]#
Allow instantiating of this class from
NodeLabel
.Attempt to get the current flow name from context if
NodeLabel.flow_name
is empty.
- AbsoluteNodeLabelInitTypes#
Types that
AbsoluteNodeLabel
can be validated from.alias of
Union
[AbsoluteNodeLabel
,NodeLabel
,Tuple
[typing.Annotated[str, ‘flow_name’], typing.Annotated[str, ‘node_name’]],List
[str
][List
[str
]], typing.Annotated[dict, ‘dict following the AbsoluteNodeLabel data model’]]