for layer in image.layers:
    if pdb.gimp_item_is_group(layer):
        gr = layer
gr_items = pdb.gimp_item_get_children(layer)
for index in gr_items[1]:
    item = gimp.Item.from_id(index)
if item.name == name:
    return item
if layer.name == name:
    return layer
return None
Get sublayers from group layer with Python in Gimp