Is there a python api for texture painting?
https://www.blender.org/api/blender_python_api_2_75_release/bpy.ops.paint.html

This official documentation has details on python api for all kinds of painting including texture painting.