Lines Matching +full:zlib +full:- +full:level
1 :mod:`zlib` --- Compression compatible with :program:`gzip`
4 .. module:: zlib
5 :synopsis: Low-level interface to compression and decompression routines
8 --------------
11 allow compression and decompression, using the zlib library. The zlib library
12 has its own home page at https://www.zlib.net. There are known
13 incompatibilities between the Python module and versions of the zlib library
14 earlier than 1.1.3; 1.1.3 has a `security vulnerability <https://zlib.net/zlib_faq.html#faq33>`_, s…
17 zlib's functions have many options and often need to be used in a particular
19 consult the zlib manual at http://www.zlib.net/manual.html for authoritative
34 Computes an Adler-32 checksum of *data*. (An Adler-32 checksum is almost as
36 is an unsigned 32-bit integer. If *value* is present, it is used as
50 .. function:: compress(data, /, level=-1)
53 *level* is an integer from ``0`` to ``9`` or ``-1`` controlling the level of compression;
56 The default value is ``-1`` (Z_DEFAULT_COMPRESSION). Z_DEFAULT_COMPRESSION represents a default
57 compromise between speed and compression (currently equivalent to level 6).
61 *level* can now be used as a keyword parameter.
64 .. function:: compressobj(level=-1, method=DEFLATED, wbits=MAX_WBITS, memLevel=DEF_MEM_LEVEL, strat…
69 *level* is the compression level -- an integer from ``0`` to ``9`` or ``-1``.
72 ``0`` (Z_NO_COMPRESSION) is no compression. The default value is ``-1`` (Z_DEFAULT_COMPRESSION).
74 (currently equivalent to level 6).
84 * +9 to +15: The base-two logarithm of the window size, which
87 resulting output will include a zlib-specific header and trailer.
103 :const:`Z_RLE` (zlib 1.2.0.1) and :const:`Z_FIXED` (zlib 1.2.2.2).
121 result is an unsigned 32-bit integer. If *value* is present, it is used
143 .. _decompress-wbits:
150 * +8 to +15: The base-two logarithm of the window size. The input
151 must include a zlib header and trailer.
153 * 0: Automatically determine the window size from the zlib header.
154 Only supported since zlib 1.2.3.5.
165 the zlib or gzip format.
168 than the size originally used to compress the stream; using a too-small
170 corresponds to the largest window size and requires a zlib header and
188 the same meaning as `described for decompress() <#decompress-wbits>`__.
220 :const:`Z_FULL_FLUSH`, :const:`Z_BLOCK` (zlib 1.2.3.4), or :const:`Z_FINISH`,
254 buffer. This data has not yet been seen by the zlib machinery, so you must feed
264 This makes it possible to distinguish between a properly-formed compressed
278 If the optional parameter *max_length* is non-zero then the return value will be
311 Information about the version of the zlib library in use is available through
317 The version string of the zlib library that was used for building the module.
318 This may be different from the zlib library actually used at runtime, which
324 The version string of the zlib library actually loaded by the interpreter.
332 Reading and writing :program:`gzip`\ -format files.
334 http://www.zlib.net
335 The zlib library home page.
337 http://www.zlib.net/manual.html
338 The zlib manual explains the semantics and usage of the library's many