This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from gzip import GzipFile | |
| from io import BytesIO | |
| def compress_string(uncompressed_string): | |
| """ | |
| Takes a string object as an argument, compresses it in memory and returns | |
| a compressed string. | |
| Any Non UTF-8 characters will be stripped during this process. | |
| :param uncompressed_string: Regular Sting |