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 for sharing your script. This saves me a huge headache!
Justin