{
    "content": [
        {
            "type": "text",
            "text": "# _bz2 (pydoc)\n\n**Summary:** bz2\n\n## Section Outline\n\n- **NAME** (2 lines)\n- **MODULE REFERENCE** (8 lines)\n- **CLASSES** (4 lines) — 2 subsections\n  - class BZ2Compressor (35 lines)\n  - class BZ2Decompressor (43 lines)\n- **FILE** (3 lines)\n\n## Full Content\n\n### NAME\n\nbz2\n\n### MODULE REFERENCE\n\nhttps://docs.python.org/3.10/library/bz2.html\n\nThe following documentation is automatically generated from the Python\nsource files.  It may be incomplete, incorrect or include features that\nare considered implementation detail and may vary between Python\nimplementations.  When in doubt, consult the module reference at the\nlocation listed above.\n\n### CLASSES\n\nbuiltins.object\nBZ2Compressor\nBZ2Decompressor\n\n#### class BZ2Compressor\n\n|  BZ2Compressor(compresslevel=9, /)\n|\n|  Create a compressor object for compressing data incrementally.\n|\n|    compresslevel\n|      Compression level, as a number between 1 and 9.\n|\n|  For one-shot compression, use the compress() function instead.\n|\n|  Methods defined here:\n|\n|  init(self, /, *args, kwargs)\n|      Initialize self.  See help(type(self)) for accurate signature.\n|\n|  compress(self, data, /)\n|      Provide data to the compressor object.\n|\n|      Returns a chunk of compressed data if possible, or b'' otherwise.\n|\n|      When you have finished providing data to the compressor, call the\n|      flush() method to finish the compression process.\n|\n|  flush(self, /)\n|      Finish the compression process.\n|\n|      Returns the compressed data left in internal buffers.\n|\n|      The compressor object may not be used after this method is called.\n|\n|  ----------------------------------------------------------------------\n|  Static methods defined here:\n|\n|  new(*args, kwargs) from builtins.type\n|      Create and return a new object.  See help(type) for accurate signature.\n\n#### class BZ2Decompressor\n\n|  Create a decompressor object for decompressing data incrementally.\n|\n|  For one-shot decompression, use the decompress() function instead.\n|\n|  Methods defined here:\n|\n|  init(self, /, *args, kwargs)\n|      Initialize self.  See help(type(self)) for accurate signature.\n|\n|  decompress(self, /, data, maxlength=-1)\n|      Decompress *data*, returning uncompressed data as bytes.\n|\n|      If *maxlength* is nonnegative, returns at most *maxlength* bytes of\n|      decompressed data. If this limit is reached and further output can be\n|      produced, *self.needsinput* will be set to ``False``. In this case, the next\n|      call to *decompress()* may provide *data* as b'' to obtain more of the output.\n|\n|      If all of the input data was decompressed and returned (either because this\n|      was less than *maxlength* bytes, or because *maxlength* was negative),\n|      *self.needsinput* will be set to True.\n|\n|      Attempting to decompress data after the end of stream is reached raises an\n|      EOFError.  Any data found after the end of the stream is ignored and saved in\n|      the unuseddata attribute.\n|\n|  ----------------------------------------------------------------------\n|  Static methods defined here:\n|\n|  new(*args, kwargs) from builtins.type\n|      Create and return a new object.  See help(type) for accurate signature.\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors defined here:\n|\n|  eof\n|      True if the end-of-stream marker has been reached.\n|\n|  needsinput\n|      True if more input is needed before more decompressed data can be produced.\n|\n|  unuseddata\n|      Data found after the end of the compressed stream.\n\n### FILE\n\n/usr/lib/python3.10/lib-dynload/bz2.cpython-310-x8664-linux-gnu.so\n\n"
        }
    ],
    "structuredContent": {
        "command": "_bz2",
        "section": "",
        "mode": "pydoc",
        "summary": "bz2",
        "synopsis": null,
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "MODULE REFERENCE",
                "lines": 8,
                "subsections": []
            },
            {
                "name": "CLASSES",
                "lines": 4,
                "subsections": [
                    {
                        "name": "class BZ2Compressor",
                        "lines": 35
                    },
                    {
                        "name": "class BZ2Decompressor",
                        "lines": 43
                    }
                ]
            },
            {
                "name": "FILE",
                "lines": 3,
                "subsections": []
            }
        ]
    }
}