With several proposed MeV gamma-ray telescopes on the horizon, it is of paramount importance to perform accurate calculations of gamma-ray spectra expected from sub-GeV dark matter annihilation and decay. We present hamza, a python package for reliably computing these spectra, determining the resulting constraints from existing gamma-ray data, and prospects for upcoming telescopes. For high-level analyses, hamza comes with several built-in dark matter models where the interactions between dark matter and hadrons have been determined in detail using chiral perturbation theory. Additionally, hamza provides tools for computing spectra from individual final states with arbitrary numbers of light leptons and mesons, and for analyzing custom dark matter models. hamza can also produce electron and positron spectra from dark matter annihilation, enabling precise derivation of constraints from the cosmic microwave background.