UV unwrap help

I’m trying to modify the cell fracture script so that it does a basic uv unwrap after it’s done fracturing the object. I’ve narrowed down the section of script where the needed verts can be selected, but I have no idea how to proceed from here:

def cell_fracture_interior_handle(objects,
use_interior_vgroup=False,
use_sharp_edges=False,
use_sharp_edges_apply=False,
):
“”“Run after doing all booleans”""

assert(use_interior_vgroup or use_sharp_edges or use_sharp_edges_apply)

for obj_cell in objects:
    mesh = obj_cell.data
    bm = bmesh.new()
    bm.from_mesh(mesh)

    ###############
    #UV unwrap section
    ###############
    #bpy.ops.uv.unwrap()
        
    
    if use_interior_vgroup:
        for bm_vert in bm.verts:
            bm_vert.tag = True
        for bm_face in bm.faces:
            if not bm_face.hide:
                for bm_vert in bm_face.verts:
                    bm_vert.tag = False

        # now add all vgroups
        defvert_lay = bm.verts.layers.deform.verify()
        for bm_vert in bm.verts:
            if bm_vert.tag:
                bm_vert[defvert_lay][0] = 1.0

        # add a vgroup
        obj_cell.vertex_groups.new(name="Interior")

    if use_sharp_edges:
        mesh.show_edge_sharp = True
        for bm_edge in bm.edges:
            if len({bm_face.hide for bm_face in bm_edge.link_faces}) == 2:
                bm_edge.smooth = False

        if use_sharp_edges_apply:
            edges = [edge for edge in bm.edges if edge.smooth is False]
            if edges:
                bm.normal_update()
                bmesh.ops.split_edges(bm, edges=edges)

    for bm_face in bm.faces:
        bm_face.hide = False

    bm.to_mesh(mesh)
    bm.free()