In order to reference a specific unique module, we need some sort of identifier to do this. Since determining a unique module is a combination of name, rarity, exclusive weapon type, exclusive equip type, etc., it's far more efficient to assign a number to them.
Unfortunately there's no automated way to do this. For the sake of simplicity, this number is just the number of the variant (you decide the order), starting at 1. Make sure every single module has a number included.