How can I converting *.dim (BEAM-DIMAP) format to the *.phs format in Python?

Hello, If anyone is familiar with InSAR processing, Please guide me to do that.
I am a beginner in python programming and searching for a way to convert *.dim format (such as interferogram) to the *.phs file format. But, so far, I did not find a solution to do what I wish.
thanks a lot,