Animating many lamps - apply the Array modifier?

I want to animate a scene with a few hundred lamps with a python script. They are to blink on and off sequentially, or randomly, or in some pattern according to an algorithm easy to write in Python. I’m assuming the best way is to set values for the Emission Strength of an emission shader node in the lamp’s material. The lamps are all identical. I have modeled one lamp. An Array Modifier produces many copies. Can a script set the brightness of each copy of the lamp independently, or do I need to apply the Array to make the lamps fully independent objects (sharing geometry, I assume)? I hesitate to apply it, due to I may try changing the total number of lamps as I refine the scene.

the built in array modifier isn’t going to be capable of what you want to do. the good news is that geometry nodes is, and doesn’t require any scripting at all.