How to write a python script to execute a .blend file and modify it
import bpy 
from random import randint 

# Generate 50 cubes in random locations for i in range(50):
bpy.ops.mesh.primitive_cube_add(location = [ randint( -10, 10 ) for axis in 'xyz' ])


Replace cube with your model and this should work.