How to align principal axes of a dopant site to x, y and z axes?

Hi all,

I was wondering if anyone knew of an existing software or python module that would be able to find the principal axes of a given (dopant) site in a crystal structure and align those principal axes to the global x, y and z axes?