compressing data in the python backend