Reworked the gzipped functionality to use to_python