Many optimization problems in power transmission networks can be formulated as polynomial problems with complex variables. A polynomial optimization problem with complex variables consists in optimizing a real-valued polynomial whose variables and coefficients are complex numbers subject to some complex polynomial equality or inequality constraints. These problems are usually directly expressed with real variables. In this work, we propose a Julia module allowing the representation of polynomial problems in their original complex formulation. This module is applied to power system optimization and its generic design enables the description of several variants of power system problems. Results for the Optimal Power Flow in Alternating Current problem and for the Preventive-Security Constrained Optimal Power Flow problem are presented.