A python library for cosmology