In the Blender interface, create a font object. With the font selected press ALT-C. A menu pops up. Instead of just clicking, wait for the tool tip to appear. The tooltip contains the bpy.ops code that you can place in your script. This is how you can discover the code for any operator used in the Blender interface. bpy.ops.object.convert(target=‘CURVE’)
The gotcha is that because it is a bpy.ops operation, you must be in the correct context when you issue the command or it fails.