I just directly translated to Python from this MATLAB script, which I've also included here. The original is public domain, so my translation is, too.
Also see Frequency estimation methods in Python for interpolating to get sharp intersample peaks
sixtenbe has posted a more powerful version here
and there's a PyPI repo
Thanks a lot for sharing this script. It works well for me too.
This script causes me register to github as I would like to say thank you.