How do you make an object local using the API I'd like to make an object (currently linked to a library) local.

I know there is bpy.ops.object.make_local function, but is there a faster solution ?

The code below works, but needs to select the object in the scene:

bpy.context.scene.objects.active = bpy.data.objects['my object']
bpy.ops.object.make_local(type='SELECT_OBJECT')
Just call make_local() on the object.

ob = bpy.data.objects['my object']
ob.make_local()