Make your python script generate the modkit ID in the carcols and carvariations.
The reason I am suggesting this, since you are automatically generating the resource, it can happen that some vehicles has the same modkit and therefor the actual modifications/tunings wont be available. All modkit should have their own unique ID.