{
    "mode": "pydoc",
    "parameter": "zlib",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/pydoc/zlib/json",
    "generated": "2026-06-02T15:03:20Z",
    "sections": {
        "NAME": {
            "content": "zlib\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "The functions in this module allow compression and decompression using the\nzlib library, which is based on GNU zip.\n",
            "subsections": [
                {
                    "name": "adler32",
                    "content": ""
                },
                {
                    "name": "compress",
                    "content": ""
                },
                {
                    "name": "compressobj",
                    "content": ""
                },
                {
                    "name": "crc32",
                    "content": ""
                },
                {
                    "name": "decompress",
                    "content": ""
                },
                {
                    "name": "decompressobj",
                    "content": "'wbits' is window buffer size and container format.\nCompressor objects support compress() and flush() methods; decompressor\nobjects support decompress() and flush().\n"
                }
            ]
        },
        "CLASSES": {
            "content": "builtins.Exception(builtins.BaseException)\nerror\n",
            "subsections": [
                {
                    "name": "class error",
                    "content": "|  Method resolution order:\n|      error\n|      builtins.Exception\n|      builtins.BaseException\n|      builtins.object\n|\n|  Data descriptors defined here:\n|\n|  weakref\n|      list of weak references to the object (if defined)\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from builtins.Exception:\n|\n|  init(self, /, *args, kwargs)\n|      Initialize self.  See help(type(self)) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Static methods inherited from builtins.Exception:\n|\n|  new(*args, kwargs) from builtins.type\n|      Create and return a new object.  See help(type) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from builtins.BaseException:\n|\n|  delattr(self, name, /)\n|      Implement delattr(self, name).\n|\n|  getattribute(self, name, /)\n|      Return getattr(self, name).\n|\n|  reduce(...)\n|      Helper for pickle.\n|\n|  repr(self, /)\n|      Return repr(self).\n|\n|  setattr(self, name, value, /)\n|      Implement setattr(self, name, value).\n|\n|  setstate(...)\n|\n|  str(self, /)\n|      Return str(self).\n|\n|  withtraceback(...)\n|      Exception.withtraceback(tb) --\n|      set self.traceback to tb and return self.\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors inherited from builtins.BaseException:\n|\n|  cause\n|      exception cause\n|\n|  context\n|      exception context\n|\n|  dict\n|\n|  suppresscontext\n|\n|  traceback\n|\n|  args\n"
                }
            ]
        },
        "FUNCTIONS": {
            "content": "",
            "subsections": [
                {
                    "name": "adler32",
                    "content": "Compute an Adler-32 checksum of data.\n\nvalue\nStarting value of the checksum.\n\nThe returned checksum is an integer.\n"
                },
                {
                    "name": "compress",
                    "content": "Returns a bytes object containing compressed data.\n\ndata\nBinary data to be compressed.\nlevel\nCompression level, in 0-9 or -1.\n"
                },
                {
                    "name": "compressobj",
                    "content": "Return a compressor object.\n\nlevel\nThe compression level (an integer in the range 0-9 or -1; default is\ncurrently equivalent to 6).  Higher compression levels are slower,\nbut produce smaller results.\nmethod\nThe compression algorithm.  If given, this must be DEFLATED.\nwbits\n+9 to +15: The base-two logarithm of the window size.  Include a zlib\ncontainer.\n-9 to -15: Generate a raw stream.\n+25 to +31: Include a gzip container.\nmemLevel\nControls the amount of memory used for internal compression state.\nValid values range from 1 to 9.  Higher values result in higher memory\nusage, faster compression, and smaller output.\nstrategy\nUsed to tune the compression algorithm.  Possible values are\nZDEFAULTSTRATEGY, ZFILTERED, and ZHUFFMANONLY.\nzdict\nThe predefined compression dictionary - a sequence of bytes\ncontaining subsequences that are likely to occur in the input data.\n"
                },
                {
                    "name": "crc32",
                    "content": "Compute a CRC-32 checksum of data.\n\nvalue\nStarting value of the checksum.\n\nThe returned checksum is an integer.\n"
                },
                {
                    "name": "decompress",
                    "content": "Returns a bytes object containing the uncompressed data.\n\ndata\nCompressed data.\nwbits\nThe window buffer size and container format.\nbufsize\nThe initial output buffer size.\n"
                },
                {
                    "name": "decompressobj",
                    "content": "Return a decompressor object.\n\nwbits\nThe window buffer size and container format.\nzdict\nThe predefined compression dictionary.  This must be the same\ndictionary as used by the compressor that produced the input data.\n"
                }
            ]
        },
        "DATA": {
            "content": "DEFLATED = 8\nDEFBUFSIZE = 16384\nDEFMEMLEVEL = 8\nMAXWBITS = 15\nZLIBRUNTIMEVERSION = '1.2.11'\nZLIBVERSION = '1.2.11'\nZBESTCOMPRESSION = 9\nZBESTSPEED = 1\nZBLOCK = 5\nZDEFAULTCOMPRESSION = -1\nZDEFAULTSTRATEGY = 0\nZFILTERED = 1\nZFINISH = 4\nZFIXED = 4\nZFULLFLUSH = 3\nZHUFFMANONLY = 2\nZNOCOMPRESSION = 0\nZNOFLUSH = 0\nZPARTIALFLUSH = 1\nZRLE = 3\nZSYNCFLUSH = 2\nZTREES = 6\n",
            "subsections": []
        },
        "VERSION": {
            "content": "1.0\n",
            "subsections": []
        },
        "FILE": {
            "content": "(built-in)\n\n",
            "subsections": []
        }
    },
    "summary": "zlib",
    "flags": [],
    "examples": [],
    "see_also": []
}