How to programmatically add an effect strip I have some test images. I want import all images into the sequence editor, one image per channel. But I want to add a transform effect strip for each image and tune it. I want to do this all programmatically.

This is my test python script:

import os
import re
import bpy

from bpy import context
scene = context.scene

path = "/path/do/images"
files = os.listdir(path)
files.sort(key=lambda var:[int(x) if x.isdigit() else x for x in re.findall(r'[^0-9]|[0-9]+', var)])

c = 1
scene.sequence_editor_create()
for f in files:
    seq = scene.sequence_editor.sequences.new_image(
        name=f,
        filepath=os.path.join(path, f),
        channel=c,
        frame_start=1)
    seq.use_reverse_frames = False
    seq.blend_type = "OVER_DROP"
    seq.frame_final_duration = 240
    # [INSERT TRANSFORM STRIP HERE]
    c += 2
    if c == 21:
        break


I skip one channel between images. I want to insert the effect strip in between.  I tried effect_strip_add:

bpy.ops.sequencer.effect_strip_add(
    type="TRANSFORM",
    channel=(c+1),
    frame_start=1)


But blender says:


  ret = op_call(self.idname_py(), None, kw) RuntimeError: Operator
  bpy.ops.sequencer.effect_strip_add.poll() failed, context is incorrect


How do I programmatically add an effect strip?
Oh. I found it.

Not need select. Just add new effect strip:

eff = scene.sequence_editor.sequences.new_effect(
    name="Transform",
    type="TRANSFORM",
    channel=(c+1),
    frame_start=1,
    frame_end=240,
    seq1=seq) # this last arg is target channel