Calling Seperate by Material from Python

I am building a character/avatar Pipeline and I am taking a character that has a single mesh for it’s torso and breaking this torso into about a dozen body parts for animation purposes. I am doing this by selecting the faces for a given body part (i.e. lHand) and then assigning a material to this groups of faces. I do this for every body part in the bigger mesh. In order to split up the mesh, I manually then enter P for separate and chose to separate by Material.

Does anybody know how to call the functionality that the P - Separate by Materials Blender command gives you so I don’t have to do this manually?

You cant but its not hard to write in python, copy the meshes, remove all faces from each that use the materials you dont want