The singularity structure of a second-order ordinary differential equation with polynomial coefficients often yields the type of solution. It is shown that the $\theta$-operator method can be used as a symbolic computational approach to obtain the indicial equation and the recurrence relation. Consequently, the singularity structure leads to the transformations that yield a solution in terms of a special function, if the equation is suitable. Hypergeometric and Heun-type equations are mostly employed in physical applications. Thus only these equations and their confluent types are considered with SageMath routines which are assembled in the open-source package symODE2.