Rotating polyhedron in lattice

Hi, I want to rotate the SO42- anions around the center S atoms in the Li2SO4 structure randomly, as shown the figure, so what can i do by pyamtgen or other packages?