zlib gzip

zlib gzip data ?-level level? ?-header dict?

This command, part of zlib, takes the bytearray data and returns its gzip-format compressed version. The -level option gives the compression level, which may be any value from 0 (uncompressed) to 9 (maximally, most slowly compressed). The -header option gives a dict that describes how to set up the gzip header. The following keys are used:

A comment string. Will be encoded as an ISO 8859-1 string.
Whether to calculate a CRC of the header. Note that the gzip utility program does not handle header CRCs.
The name of the original file. Will be encoded as an ISO 8859-1 string.
The integer operating system code. The value should be one of those described in RFC 1952.
The mtime of the originating file.
The (guessed) type of the file, either text or binary.