What I usually do is assign all my materials to a Cube and append it, and the materials just come with it.
The problem is that
bpy.ops.wp.append() require a filename, and I have no way that I know to create a for loop that would cycle through all the mats in the file and append them. Usually when I want to import all files in a folder I use
glob.glob() to create a list but that obviously wouldn't work in this case. Is there an equivalent to
glob.glob() for a blend file?
Appending the cube has it's limit since I need to remember to assign my materials to it, and when you are working with hundreds of mats it becomes problematic.