@@ -11,12 +11,12 @@ For applications that require data compression, the functions in this module
1111allow compression and decompression, using the zlib library. The zlib library
1212has its own home page at https://www.zlib.net. There are known
1313incompatibilities 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 >`_, so we recommend using
15- 1.1.4 or later.
14+ earlier than 1.1.3; 1.1.3 has a `security vulnerability <https://zlib.net/zlib_faq.html#faq33 >`_,
15+ so we recommend using 1.1.4 or later.
1616
1717zlib's functions have many options and often need to be used in a particular
1818order. This documentation doesn't attempt to cover all of the permutations;
19- consult the zlib manual at http ://www.zlib.net/manual.html for authoritative
19+ consult the ` zlib manual < https ://www.zlib.net/manual.html>`_ for authoritative
2020information.
2121
2222For reading and writing ``.gz `` files see the :mod: `gzip ` module.
@@ -340,6 +340,122 @@ Decompression objects support the following methods and attributes:
340340 objects.
341341
342342
343+ The following constants are available to configure compression and decompression
344+ behavior:
345+
346+ .. data :: DEFLATED
347+
348+ The deflate compression method.
349+
350+
351+ .. data :: MAX_WBITS
352+
353+ The maximum window buffer size.
354+
355+
356+ .. data :: DEF_MEM_LEVEL
357+
358+ The default memory level for compression objects.
359+
360+
361+ .. data :: DEF_BUF_SIZE
362+
363+ The default buffer size for decompression operations.
364+
365+
366+ .. data :: Z_NO_COMPRESSION
367+
368+ Compression level ``0 ``.
369+
370+
371+ .. data :: Z_BEST_SPEED
372+
373+ Compression level ``1 ``.
374+
375+
376+ .. data :: Z_BEST_COMPRESSION
377+
378+ Compression level ``9 ``.
379+
380+
381+ .. data :: Z_DEFAULT_COMPRESSION
382+
383+ Default compression level ``-1 ``.
384+
385+
386+ .. data :: Z_DEFAULT_STRATEGY
387+
388+ Default compression strategy, for normal data.
389+
390+
391+ .. data :: Z_FILTERED
392+
393+ Compression strategy for data produced by a filter (or predictor).
394+
395+
396+ .. data :: Z_HUFFMAN_ONLY
397+
398+ Compression strategy that forces Huffman coding only.
399+
400+
401+ .. data :: Z_RLE
402+
403+ Compression strategy that limits match distances to one (run-length encoding).
404+
405+ This constant is only available if Python was compiled with zlib
406+ 1.2.0.1 or greater.
407+
408+
409+ .. data :: Z_FIXED
410+
411+ Compression strategy that prevents the use of dynamic Huffman codes.
412+
413+ This constant is only available if Python was compiled with zlib
414+ 1.2.2.2 or greater.
415+
416+
417+ .. data :: Z_NO_FLUSH
418+
419+ Flush mode ``0 ``. No special flushing behavior.
420+
421+
422+ .. data :: Z_PARTIAL_FLUSH
423+
424+ Flush mode ``1 ``. Flush as much output as possible.
425+
426+
427+ .. data :: Z_SYNC_FLUSH
428+
429+ Flush mode ``2 ``. All output is flushed and the output is aligned to a byte boundary.
430+
431+
432+ .. data :: Z_FULL_FLUSH
433+
434+ Flush mode ``3 ``. All output is flushed and the compression state is reset.
435+
436+
437+ .. data :: Z_FINISH
438+
439+ Flush mode ``4 ``. All pending input is processed, no more input is expected.
440+
441+
442+ .. data :: Z_BLOCK
443+
444+ Flush mode ``5 ``. A deflate block is completed and emitted.
445+
446+ This constant is only available if Python was compiled with zlib
447+ 1.2.2.2 or greater.
448+
449+
450+ .. data :: Z_TREES
451+
452+ Flush mode ``6 ``, for inflate operations. Instructs inflate to return when
453+ it gets to the next deflate block boundary.
454+
455+ This constant is only available if Python was compiled with zlib
456+ 1.2.3.4 or greater.
457+
458+
343459Information about the version of the zlib library in use is available through
344460the following constants:
345461
@@ -375,10 +491,10 @@ the following constants:
375491 Module :mod: `gzip `
376492 Reading and writing :program: `gzip `\ -format files.
377493
378- http ://www.zlib.net
494+ https ://www.zlib.net
379495 The zlib library home page.
380496
381- http ://www.zlib.net/manual.html
497+ https ://www.zlib.net/manual.html
382498 The zlib manual explains the semantics and usage of the library's many
383499 functions.
384500
0 commit comments