Porting Blender's UV Unwrapping Operators to Python

Made a blog post on something that I did a couple of months ago but forgot about until now.

(Not sure if this is allowed on BlenderArtists?)

Worth knowing if you’re porting these: the operators do run headless. bpy.ops.uv.unwrap comes back FINISHED under blender -b with no window, and writes the layer.

Two things I measured across seven versions, 3.6.23 to 5.2.1. The signature isn’t stable. Six arguments on 3.6 and 4.2, eleven from 4.5, twelve on 5.2 once use_original_bounds turned up, and method gained MINIMUM_STRETCH somewhere in there.

The second surprised me. Ten runs, same session, same sphere: unwrap gave one distinct UV area every time, smart_project gave three on 3.6.23 and two on 4.5.13. So smart_project isn’t reproducible, which would bite anyone diffing output.