Converting nodes into python script

For various purposes I might want the code that generates the structure of a node group, I want to convert the code into a script that when run can regenerate the nodes I made in shader or geometry nodes.

I could find various things on this, but nothing worked, apparently the Node wrangler addon should have a convert to python feature I cannot find.

I think these two products that seem to do what you want:

And don’t forget:

1 Like