Here's a tiny calculator for moon phase that I kludged up ca. 2018 but (at least as of this month) is still tracking the full moon (which makes sense given that the algo came out of a dead tree source from over half a century ago?):<p><pre><code> _=min
lphase = lambda y,m,d: _( lkp(ph,p)
for lkp in [lambda t,x: _(v for (kl,v),(kh,w)
in zip(t,t[1:]) if kl <= x < kh)]
for daynum in [lambda y,m,d: daynum(y-1,m+12,d) if m<3 else
y*365 + y//4 - y//100 + y//400 + (153*m+3)//5 + d]
for o in [daynum(y,m,d)-daynum(2000,1,6)]
for p in [o%29.53] # mean; varies significantly!
for ph in [[(0,"new"),(0.5,"waxing crescent"),(7,"first quarter"),
(8,"waxing gibbous"),(14.5,"full"),(15.5,"waning gibbous"),
(21.7,"last quarter"),(22.7,"waning crescent"),(29,"new"),
(30,None)]] )</code></pre>