How to script boolean operation?

Greetings! I’m relatively new to Blender and completely new to Python. I’m trying to write a small script to perform a boolean operation on two meshes from the command line (no gui). Here’s what I want to accomplish:

  • Import two meshes in obj format, i.e. the source mesh and target mesh
  • Perform a boolean operation on the two meshes (e.g. difference to subtract target from source)
  • export the modified mesh as obj

Any help is greatly appreciated!

What have you tried? What have you searched?

Re:1 there is an import operator template with blender
Re 2.

Re: 3. Same as 1