Python FBX Export Collection and set FBX file name as Collection name
Some help
Script to export all objects in the context collection into a file named after the collection, into the folder of the blend file.
import bpy
from pathlib import Path

context = bpy.context
scene =  context.scene

#for coll in scene.collection.children: # all 
for coll in [context.collection]:
    bpy.ops.export_scene.fbx(
            {
                &quot;object&quot; : None,
                &quot;active_object&quot; : None,
                &quot;selected_objects&quot; : coll.all_objects,
             },
             filepath=str(
                    Path(bpy.data.filepath).parent
                    / f&quot;{coll.name}.fbx&quot;
                    ),
             use_selection=True,
             )