Ion displacements are the fundamental cause of ferroelectricity in perovskites. By properly shifting ions, ab initio computations have been extensively used to investigate the properties of perovskites in various structural phases. In addition to the relatively simple ion displacements, perovskites have another type of structural distortion known as antiferrodistortion or oxygen octahedron tilting. The interplay between these two types of distortions have generated abundant structural phases that can be tedious to prepare for ab initio computation, especially for large supercells. Here, we design and implement a computer program to facilitate the generation of distorted perovskite structures, which can be readily used for ab initio computation to gain further insight into the perovskite of a given structural phase.