https://blender.stackexchange.com/questions/43686/how-can-i-remove-a-linked-library-with-python
Dec 26, 2015 — Newer versions of Blender provide the batch_remove method in the bpy.types.BlendData type. So you can call: bpy.data.batch_remove(ids=(my_library,))