# How to get / set my_node.inputs or node.outputs .keys()?

I'm trying to access the keys of a particular node of inputs and outputs. to access the use property keys:

n = my_node #(From node_tree.nodes)

for key in n.bl_rna.properties.keys():
attributes = getattr(n, key)


now I would like to access the attributes of n.inputs and n.outputs

but this does not produce any results:

for key in n.outputs.bl_rna.properties.keys():
attributes = getattr(n.outputs, key)


Edit: For more details, this would serve to copy the nodes and their properties. But when I have to access the inputs and outputs properties I have difficulties at the moment, post a small test that I am running, for now it does not work properly, but perhaps it makes better understand what I am trying to do

for n in bpy.context.scene.node_tree.nodes:
tipo_di_nodo = n.bl_rna.identifier ##Ty @batFINGER
nodo_copiato = bpy.context.scene.node_tree.nodes.new(tipo_di_nodo)

#This copies the node exactly, with some data
for key in n.bl_rna.properties.keys():
source_attribute = getattr(n, key)
setattr(nodo_copiato, key, source_attribute)

#I would like it to copy and assign value inputs
#For now this is not working
for val in n.inputs.values():
for key in val.bl_rna.properties.keys():
in_source_attribute = getattr(val,key)

• I take it the big picture is "How to copy a node tree?" Or "How to copy a node" One suggested small change to above tipo_di_nodo = n.bl_rna.identifier Enjoying getting my Aussie accent around the Espanol – batFINGER Jan 24 at 4:31
• Ok, thanks. If that operator is too hard to understand, take my advice and remove all nodes of the shader in the first place then create the shader each time from scratch to save you headaches. One big issue is that all default values of each node type are 0. There is no way to "reset" the values of any node and you have to create a new node to get the default values anyway... and really, the API of the node editor isn't the greatest part @Pastrokkio – brockmann Jan 24 at 9:45