{
    "content": [
        {
            "type": "text",
            "text": "# lzma (pydoc)\n\n## TLDR\n\n> This command is an alias of `xz --format lzma`.\n\n- View documentation for the original command:\n  `tldr xz`\n\n*Source: tldr-pages*\n\n---\n\n**Summary:** lzma - Interface to the liblzma compression library.\n\n## Section Outline\n\n- **NAME** (2 lines)\n- **MODULE REFERENCE** (8 lines)\n- **DESCRIPTION** (7 lines)\n- **CLASSES** (8 lines) — 4 subsections\n  - class LZMACompressor (53 lines)\n  - class LZMADecompressor (63 lines)\n  - class LZMAError (69 lines)\n  - class LZMAFile (213 lines)\n- **FUNCTIONS** (1 lines) — 4 subsections\n  - compress (7 lines)\n  - decompress (7 lines)\n  - is_check_supported (4 lines)\n  - open (22 lines)\n- **DATA** (30 lines)\n- **FILE** (3 lines)\n\n## Full Content\n\n### NAME\n\nlzma - Interface to the liblzma compression library.\n\n### MODULE REFERENCE\n\nhttps://docs.python.org/3.10/library/lzma.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### DESCRIPTION\n\nThis module provides a class for reading and writing compressed files,\nclasses for incremental (de)compression, and convenience functions for\none-shot (de)compression.\n\nThese classes and functions support both the XZ and legacy LZMA\ncontainer formats, as well as raw compressed data streams.\n\n### CLASSES\n\ncompression.BaseStream(io.BufferedIOBase)\nLZMAFile\nbuiltins.Exception(builtins.BaseException)\nlzma.LZMAError\nbuiltins.object\nlzma.LZMACompressor\nlzma.LZMADecompressor\n\n#### class LZMACompressor\n\n|  LZMACompressor(format=FORMATXZ, check=-1, preset=None, filters=None)\n|\n|  Create a compressor object for compressing data incrementally.\n|\n|  format specifies the container format to use for the output. This can\n|  be FORMATXZ (default), FORMATALONE, or FORMATRAW.\n|\n|  check specifies the integrity check to use. For FORMATXZ, the default\n|  is CHECKCRC64. FORMATALONE and FORMATRAW do not support integrity\n|  checks; for these formats, check must be omitted, or be CHECKNONE.\n|\n|  The settings used by the compressor can be specified either as a\n|  preset compression level (with the 'preset' argument), or in detail\n|  as a custom filter chain (with the 'filters' argument). For FORMATXZ\n|  and FORMATALONE, the default is to use the PRESETDEFAULT preset\n|  level. For FORMATRAW, the caller must always specify a filter chain;\n|  the raw compressor does not support preset compression levels.\n|\n|  preset (if provided) should be an integer in the range 0-9, optionally\n|  OR-ed with the constant PRESETEXTREME.\n|\n|  filters (if provided) should be a sequence of dicts. Each dict should\n|  have an entry for \"id\" indicating the ID of the filter, plus\n|  additional entries for options to the filter.\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 LZMADecompressor\n\n|  LZMADecompressor(format=0, memlimit=None, filters=None)\n|\n|  Create a decompressor object for decompressing data incrementally.\n|\n|    format\n|      Specifies the container format of the input stream.  If this is\n|      FORMATAUTO (the default), the decompressor will automatically detect\n|      whether the input is FORMATXZ or FORMATALONE.  Streams created with\n|      FORMATRAW cannot be autodetected.\n|    memlimit\n|      Limit the amount of memory used by the decompressor.  This will cause\n|      decompression to fail if the input cannot be decompressed within the\n|      given limit.\n|    filters\n|      A custom filter chain.  This argument is required for FORMATRAW, and\n|      not accepted with any other format.  When provided, this should be a\n|      sequence of dicts, each indicating the ID and options for a single\n|      filter.\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|  check\n|      ID of the integrity check used by the input stream.\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#### class LZMAError\n\n|  Call to liblzma failed.\n|\n|  Method resolution order:\n|      LZMAError\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\n#### class LZMAFile\n\n|  LZMAFile(filename=None, mode='r', *, format=None, check=-1, preset=None, filters=None)\n|\n|  A file object providing transparent LZMA (de)compression.\n|\n|  An LZMAFile can act as a wrapper for an existing file object, or\n|  refer directly to a named file on disk.\n|\n|  Note that LZMAFile provides a *binary* file interface - data read\n|  is returned as bytes, and data to be written must be given as bytes.\n|\n|  Method resolution order:\n|      LZMAFile\n|      compression.BaseStream\n|      io.BufferedIOBase\n|      io.BufferedIOBase\n|      io.IOBase\n|      io.IOBase\n|      builtins.object\n|\n|  Methods defined here:\n|\n|  init(self, filename=None, mode='r', *, format=None, check=-1, preset=None, filters=None)\n|      Open an LZMA-compressed file in binary mode.\n|\n|      filename can be either an actual file name (given as a str,\n|      bytes, or PathLike object), in which case the named file is\n|      opened, or it can be an existing file object to read from or\n|      write to.\n|\n|      mode can be \"r\" for reading (default), \"w\" for (over)writing,\n|      \"x\" for creating exclusively, or \"a\" for appending. These can\n|      equivalently be given as \"rb\", \"wb\", \"xb\" and \"ab\" respectively.\n|\n|      format specifies the container format to use for the file.\n|      If mode is \"r\", this defaults to FORMATAUTO. Otherwise, the\n|      default is FORMATXZ.\n|\n|      check specifies the integrity check to use. This argument can\n|      only be used when opening a file for writing. For FORMATXZ,\n|      the default is CHECKCRC64. FORMATALONE and FORMATRAW do not\n|      support integrity checks - for these formats, check must be\n|      omitted, or be CHECKNONE.\n|\n|      When opening a file for reading, the *preset* argument is not\n|      meaningful, and should be omitted. The *filters* argument should\n|      also be omitted, except when format is FORMATRAW (in which case\n|      it is required).\n|\n|      When opening a file for writing, the settings used by the\n|      compressor can be specified either as a preset compression\n|      level (with the *preset* argument), or in detail as a custom\n|      filter chain (with the *filters* argument). For FORMATXZ and\n|      FORMATALONE, the default is to use the PRESETDEFAULT preset\n|      level. For FORMATRAW, the caller must always specify a filter\n|      chain; the raw compressor does not support preset compression\n|      levels.\n|\n|      preset (if provided) should be an integer in the range 0-9,\n|      optionally OR-ed with the constant PRESETEXTREME.\n|\n|      filters (if provided) should be a sequence of dicts. Each dict\n|      should have an entry for \"id\" indicating ID of the filter, plus\n|      additional entries for options to the filter.\n|\n|  close(self)\n|      Flush and close the file.\n|\n|      May be called more than once without error. Once the file is\n|      closed, any other operation on it will raise a ValueError.\n|\n|  fileno(self)\n|      Return the file descriptor for the underlying file.\n|\n|  peek(self, size=-1)\n|      Return buffered data without advancing the file position.\n|\n|      Always returns at least one byte of data, unless at EOF.\n|      The exact number of bytes returned is unspecified.\n|\n|  read(self, size=-1)\n|      Read up to size uncompressed bytes from the file.\n|\n|      If size is negative or omitted, read until EOF is reached.\n|      Returns b\"\" if the file is already at EOF.\n|\n|  read1(self, size=-1)\n|      Read up to size uncompressed bytes, while trying to avoid\n|      making multiple reads from the underlying stream. Reads up to a\n|      buffer's worth of data if size is negative.\n|\n|      Returns b\"\" if the file is at EOF.\n|\n|  readable(self)\n|      Return whether the file was opened for reading.\n|\n|  readline(self, size=-1)\n|      Read a line of uncompressed bytes from the file.\n|\n|      The terminating newline (if present) is retained. If size is\n|      non-negative, no more than size bytes will be read (in which\n|      case the line may be incomplete). Returns b'' if already at EOF.\n|\n|  seek(self, offset, whence=0)\n|      Change the file position.\n|\n|      The new position is specified by offset, relative to the\n|      position indicated by whence. Possible values for whence are:\n|\n|          0: start of stream (default): offset must not be negative\n|          1: current stream position\n|          2: end of stream; offset must not be positive\n|\n|      Returns the new file position.\n|\n|      Note that seeking is emulated, so depending on the parameters,\n|      this operation may be extremely slow.\n|\n|  seekable(self)\n|      Return whether the file supports seeking.\n|\n|  tell(self)\n|      Return the current file position.\n|\n|  writable(self)\n|      Return whether the file was opened for writing.\n|\n|  write(self, data)\n|      Write a bytes object to the file.\n|\n|      Returns the number of uncompressed bytes written, which is\n|      always the length of data in bytes. Note that due to buffering,\n|      the file on disk may not reflect the data written until close()\n|      is called.\n|\n|  ----------------------------------------------------------------------\n|  Readonly properties defined here:\n|\n|  closed\n|      True if this file is closed.\n|\n|  ----------------------------------------------------------------------\n|  Data and other attributes defined here:\n|\n|  abstractmethods = frozenset()\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from io.BufferedIOBase:\n|\n|  detach(self, /)\n|      Disconnect this buffer from its underlying raw stream and return it.\n|\n|      After the raw stream has been detached, the buffer is in an unusable\n|      state.\n|\n|  readinto(self, buffer, /)\n|\n|  readinto1(self, buffer, /)\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from io.IOBase:\n|\n|  del(...)\n|\n|  enter(...)\n|\n|  exit(...)\n|\n|  iter(self, /)\n|      Implement iter(self).\n|\n|  next(self, /)\n|      Implement next(self).\n|\n|  flush(self, /)\n|      Flush write buffers, if applicable.\n|\n|      This is not implemented for read-only and non-blocking streams.\n|\n|  isatty(self, /)\n|      Return whether this is an 'interactive' stream.\n|\n|      Return False if it can't be determined.\n|\n|  readlines(self, hint=-1, /)\n|      Return a list of lines from the stream.\n|\n|      hint can be specified to control the number of lines read: no more\n|      lines will be read if the total size (in bytes/characters) of all\n|      lines so far exceeds hint.\n|\n|  truncate(...)\n|      Truncate file to size bytes.\n|\n|      File pointer is left unchanged.  Size defaults to the current IO\n|      position as reported by tell().  Returns the new size.\n|\n|  writelines(self, lines, /)\n|      Write a list of lines to stream.\n|\n|      Line separators are not added, so it is usual for each of the\n|      lines provided to have a line separator at the end.\n|\n|  ----------------------------------------------------------------------\n|  Static methods inherited from io.IOBase:\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 inherited from io.IOBase:\n|\n|  dict\n\n### FUNCTIONS\n\n#### compress\n\nCompress a block of data.\n\nRefer to LZMACompressor's docstring for a description of the\noptional arguments *format*, *check*, *preset* and *filters*.\n\nFor incremental compression, use an LZMACompressor instead.\n\n#### decompress\n\nDecompress a block of data.\n\nRefer to LZMADecompressor's docstring for a description of the\noptional arguments *format*, *check* and *filters*.\n\nFor incremental decompression, use an LZMADecompressor instead.\n\n#### is_check_supported\n\nTest whether the given integrity check is supported.\n\nAlways returns True for CHECKNONE and CHECKCRC32.\n\n#### open\n\nOpen an LZMA-compressed file in binary or text mode.\n\nfilename can be either an actual file name (given as a str, bytes,\nor PathLike object), in which case the named file is opened, or it\ncan be an existing file object to read from or write to.\n\nThe mode argument can be \"r\", \"rb\" (default), \"w\", \"wb\", \"x\", \"xb\",\n\"a\", or \"ab\" for binary mode, or \"rt\", \"wt\", \"xt\", or \"at\" for text\nmode.\n\nThe format, check, preset and filters arguments specify the\ncompression settings, as for LZMACompressor, LZMADecompressor and\nLZMAFile.\n\nFor binary mode, this function is equivalent to the LZMAFile\nconstructor: LZMAFile(filename, mode, ...). In this case, the\nencoding, errors and newline arguments must not be provided.\n\nFor text mode, an LZMAFile object is created, and wrapped in an\nio.TextIOWrapper instance with the specified encoding, error\nhandling behavior, and line ending(s).\n\n### DATA\n\nCHECKCRC32 = 1\nCHECKCRC64 = 4\nCHECKIDMAX = 15\nCHECKNONE = 0\nCHECKSHA256 = 10\nCHECKUNKNOWN = 16\nFILTERARM = 7\nFILTERARMTHUMB = 8\nFILTERDELTA = 3\nFILTERIA64 = 6\nFILTERLZMA1 = 4611686018427387905\nFILTERLZMA2 = 33\nFILTERPOWERPC = 5\nFILTERSPARC = 9\nFILTERX86 = 4\nFORMATALONE = 2\nFORMATAUTO = 0\nFORMATRAW = 3\nFORMATXZ = 1\nMFBT2 = 18\nMFBT3 = 19\nMFBT4 = 20\nMFHC3 = 3\nMFHC4 = 4\nMODEFAST = 1\nMODENORMAL = 2\nPRESETDEFAULT = 6\nPRESETEXTREME = 2147483648\nall = ['CHECKNONE', 'CHECKCRC32', 'CHECKCRC64', 'CHECKSHA256',...\n\n### FILE\n\n/usr/lib/python3.10/lzma.py\n\n"
        }
    ],
    "structuredContent": {
        "command": "lzma",
        "section": "",
        "mode": "pydoc",
        "summary": "lzma - Interface to the liblzma compression library.",
        "synopsis": null,
        "tldr_summary": "This command is an alias of `xz --format lzma`.",
        "tldr_examples": [
            {
                "description": "View documentation for the original command",
                "command": "tldr xz"
            }
        ],
        "tldr_source": "official",
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "MODULE REFERENCE",
                "lines": 8,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 7,
                "subsections": []
            },
            {
                "name": "CLASSES",
                "lines": 8,
                "subsections": [
                    {
                        "name": "class LZMACompressor",
                        "lines": 53
                    },
                    {
                        "name": "class LZMADecompressor",
                        "lines": 63
                    },
                    {
                        "name": "class LZMAError",
                        "lines": 69
                    },
                    {
                        "name": "class LZMAFile",
                        "lines": 213
                    }
                ]
            },
            {
                "name": "FUNCTIONS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "compress",
                        "lines": 7
                    },
                    {
                        "name": "decompress",
                        "lines": 7
                    },
                    {
                        "name": "is_check_supported",
                        "lines": 4
                    },
                    {
                        "name": "open",
                        "lines": 22
                    }
                ]
            },
            {
                "name": "DATA",
                "lines": 30,
                "subsections": []
            },
            {
                "name": "FILE",
                "lines": 3,
                "subsections": []
            }
        ]
    }
}