CurveBoolean with python

I’m trying to get a closed shape from some curves I have created with a script. From what I see all the boolean options that closed curves but i have come open curves. How can i get something like the curveboolean command that allows you to also select open curves also without having to manually click in the regions.

this is your startingpoint:
https://developer.rhino3d.com/api/rhinocommon/rhino.geometry.curve/createbooleanregions