How to get all types of nodes dynamically? The node editor is constantly changing due to cycles. There are new nodes in every release of blender so I'd like to know whether there is a way to get all available node types in a list. I remembered that Node Wrangler has this beautiful "switch my node to something else" thing, which I thought already implements that functionality. However, all nodes are hard coded like that:

shaders_output_nodes_props = (
    ('ShaderNodeOutputMaterial', 'OUTPUT_MATERIAL', 'Material Output'),
    ('ShaderNodeOutputLamp', 'OUTPUT_LAMP', 'Lamp Output'),
    ('ShaderNodeOutputWorld', 'OUTPUT_WORLD', 'World Output'),
)


Q: Is there a way to get a complete list of all available node types by category and ideally all custom groups as well with bpy.types or something similar?
This addresses the second part of your question. How to auto generate all this.

Node Category (cycles) and each registered node.bl_idname in the category

import bpy

ddir = lambda data, filter_str: [i for i in dir(data) if i.startswith(filter_str)]
get_nodes = lambda cat: [i for i in getattr(bpy.types, cat).category.items(None)]

cycles_categories = ddir(bpy.types, "NODE_MT_category_SH_NEW")
for cat in cycles_categories: 
    print(cat)
    for node in get_nodes(cat):
        print('bl_idname: {node.nodetype}, type: {node.label}'.format(node=node))      


Output is (snipped):

NODE_MT_category_SH_NEW_CONVERTOR
bl_idname: ShaderNodeBlackbody, type: Blackbody
bl_idname: ShaderNodeValToRGB, type: ColorRamp
bl_idname: ShaderNodeCombineHSV, type: Combine HSV
bl_idname: ShaderNodeCombineRGB, type: Combine RGB
bl_idname: ShaderNodeCombineXYZ, type: Combine XYZ
bl_idname: ShaderNodeMath, type: Math
bl_idname: ShaderNodeRGBToBW, type: RGB to BW


Custom Node Groups of type ShaderNodeTree

[ng for ng in bpy.data.node_groups if ng.bl_idname == 'ShaderNodeTree']