Mousing over the base of a menu gives you the bl_idname
.

If you right click and select edit source it will open up the code for that space in the text editor

In this file you will find
class INFO_MT_file_export(Menu):
bl_idname = "INFO_MT_file_export"
bl_label = "Export"
def draw(self, context):
if bpy.app.build_options.collada:
self.layout.operator("wm.collada_export", text="Collada (Default) (.dae)")
if bpy.app.build_options.alembic:
self.layout.operator("wm.alembic_export", text="Alembic (.abc)")
which affirms that it is a Menu
class. The naming convention used by blender for operators and menus is <SPACE>_<TYPE>_<name>
where in this case it's the INFO
space, is menu type MT
and named file_export
.
When a blender menu (or operator) is registered it becomes known to bpy.types
. If the naming convention is followed, we can find all menus in the info space, simply by using auto-complete in the python console.
>>> bpy.types.INFO_MT_
add(
armature_add(
...
file(
file_export(
file_external_data(
file_import(
file_previews(
...
window(
To get a complete list of all menus, you can use python's built-in dir()
function:
base_type = bpy.types.Menu
for typename in dir(bpy.types):
bl_type = getattr(bpy.types, typename)
if issubclass(bl_type, base_type):
print (bl_type)