Python package for supernova cosmology based on AstroPy