Speaking of treating population dynamics mathematically… compartmental models are still some of my favorites https://pypi.org/project/epidemik