I dont know why people make this harder than it needs to be, make group of lights, change colors and duplicate, its good enough, no need to use python api.
Obviously just an example, but even so, unless you already have the workflow established, writing human text describing something could be easier than manually doing it.