How to go from wav file to spectrogram back to wav file in python? Close to this question but different : Wav To Spectrogram, Back To Wav

I already posted this on StackOverflow(https://stackoverflow.com/questions/54743968/how-to-go-from-wav-file-to-spectrogram-back-to-wav-file-in-python), but I figured this question might be more suited to be here : 

Here's my problem. I have some wav files. I want to create their spectrogram. Then I want to do some stuff with the spectrogram and then I want to recreate a wav file associated to the new spectrogram. I am aware that the spectrogram doesn't have the phase information, however, since I have an original file, I can (theoretically) extract the phase from the original wav file.

I want to do that in Python (if possible), do you know a good library that would allow me to do that?
You need to keep the phase information, which isn't included in a spectrogram.  "Spectrogram" is just the magnitude of the STFT output.

So this is conceptually the same as STFT ↔ ISTFT, which is supported in Python now:


STFT
ISTFT


The Examples section in the ISTFT link does exactly what you want, modifying a STFT and inverse transforming to reduce noise.