Predicting solar eclipses with Python

from blog Home on Erik Bernhardsson, | ↗ original
As I am en route to see my first total solar eclipse, I was curious how hard it would be to compute eclipses in Python. It turns out, ignoring some minor coordinate system head-banging, I was able to get something half-decent working in a couple of hours.