Beveling edges with varying number of segments (preferably programatically)
As the index of an item changes as edits are made to the mesh you need to get each edge object before making any changes, then refer to each edge as you do the bevel. You can use the edges verts property to get the vertices at each end.

import bpy, bmesh

bpy.ops.object.mode_set(mode='EDIT')
me = bpy.context.edit_object.data

# edge_bevel_data
ebd = [
{'idx': 13, 'edge': None, 'offset': 0.05, 'segments': 3},
{'idx': 32, 'edge': None, 'offset': 0.04, 'segments': 2},
{'idx': 89, 'edge': None, 'offset': 0.06, 'segments': 3},
]

bm = bmesh.from_edit_mesh(me)

# first get the edges
for i in range(len(ebd)):
    ebd[i]['edge'] = bm.edges[ebd[i]['idx']]

# bevel each edge
for i in range(len(ebd)):
    e = ebd[i]['edge']
    bev_geom = [e.verts[0], e.verts[1], e]
    o = ebd[i]['offset']
    s = ebd[i]['segments']
    bmesh.ops.bevel(bm, geom=bev_geom, offset=o, segments=s)

bmesh.update_edit_mesh(me, True)