nodify.NodeConverter
- class nodify.NodeConverter(*args, assign_fn: str | None = None, node_cls_name: str = 'Node', constant_cls: str = 'ConstantNode', nodify_constants: bool = False, nodify_constant_assignments: bool = False, remove_function_annotations: bool = False, **kwargs)[source]
AST transformer that converts a function into a workflow.
- __init__(*args, assign_fn: str | None = None, node_cls_name: str = 'Node', constant_cls: str = 'ConstantNode', nodify_constants: bool = False, nodify_constant_assignments: bool = False, remove_function_annotations: bool = False, **kwargs)[source]
Methods
__init__
(*args[, assign_fn, node_cls_name, ...])generic_visit
(node)Called if no explicit visitor function exists for a node.
visit
(node)Visit a node.
visit_Assign
(node)Converts some_module.some_attr(some_args) into Node.from_func(some_module.some_attr)(some_args)
visit_Call
(node)Converts some_module.some_attr(some_args) into Node.from_func(some_module.some_attr)(some_args)
visit_Constant
(node)visit_Dict
(node)Converts the dict syntax into a call to the DictNode.
visit_FunctionDef
(node)visit_IfExp
(node)Converts the if expression syntax into a call to the ConditionalExpressionNode.
visit_List
(node)Converts the list syntax into a call to the ListNode.
visit_Tuple
(node)Converts the tuple syntax into a call to the TupleNode.