Plugin to save node tree for python coding

I am wondering is there any tool/plugin in blender, that lets you save your node tree (shader or/and geometry nodes) in a cfg file, which you load via a python code.
So I would to setup a node tree in blender. Select a region of the tree or the entire tree and save it to a file, which I can load via a python script. Ideally I would like to get the handle for the nodes via a dict, where the names of the nodes are the keys in the dict. Does such a tool exist?

Thanks a lot,

blackSnow

I don’t have a complete solution, but I was working on something like this a long time ago. Let me give you a couple of lines that might help. You should know this was in 2.7 days, so some things may have changed since then, but I can tell you how to add nodes from a dict and get the nodes to add to a dict:

bpy.context.scene.use_nodes = True
tree = bpy.context.scene.node_tree
space = bpy.context.view_layer.objects.active
space.select_set(state=True)
ntree = space.active_material

ADD NODES from FILE
for node in node_dictionary:
ntree.node_tree.nodes.new(node)

GET NODES to save to FILE
#do something with...
ntree.node_tree.nodes