SOAP: a Python package for calculating the properties of galaxies and halos formed in cosmological simulations