PyDocs

Nav

Data Compression and Archiving

compress

zlib

function
  • compress(data, /, level=Z_DEFAULT_COMPRESSION, wbits=MAX_WBITS)
Returns a bytes object containing compressed data.

data
  Binary data to be compressed.
level
  Compression level, in 0-9 or -1.
wbits
  The window buffer size and container format.
Changed in 3.6, 3.11
  • 3.6: level can now be used as a keyword parameter.
  • 3.11: The wbits parameter is now available to set window bits and compression type.
0 Examples
No examples for zlib/compress.
See Also
No see-alsos for zlib/compress
0 Notes
No notes for compress