rest python script