Rotate UV by specific angle e.g. 30deg in Python script in backgroud mode
you can do the math yourself , if nothing is available :
rotate all the points around the center of the image (0.5, 0.5)

import bpy
from math import cos, sin, radians


def make_rotation_transformation(angle, origin=(0, 0)):
    cos_theta, sin_theta = cos(angle), sin(angle)
    x0, y0 = origin    
    def xform(point):
        x, y = point[0] - x0, point[1] - y0
        return (x * cos_theta - y * sin_theta + x0,
                x * sin_theta + y * cos_theta + y0)
    return xform


ob = bpy.context.object
rad = radians(30)
anchor = (0.5, 0.5)

rot = make_rotation_transformation(rad, anchor)

UVmap = ob.data.uv_layers.active
for v in ob.data.loops :
     UVmap.data[v.index].uv = rot(UVmap.data[v.index].uv ) 


the make_rotation_transformation  is from this answer   by @200-success