Set a projector at UVProjection modifier (script)
Similar to How to add modifiers using python script and set parameters?, the recommended way is to add a new modifier to an object using ObjectModifiers.new() which returns the reference to the modifier and allows to assign whatever you like:
import bpy

# Get the object in context
obj = bpy.context.object

# Add the modifier to the object in context
modifier = obj.modifiers.new(name=&quot;project&quot;, type='UV_PROJECT')

# Properties
modifier.uv_layer = &quot;UVMap&quot;
modifier.projector_count = 10

for p in modifier.projectors:
    p.object = bpy.context.scene.camera

projectors property is of type bpy_prop_collection, which is essentially a list of object references. In order to assign an object to each Object property of the modifier, you would have to assign an object reference like bpy.context.scene.camera.