{
    "content": [
        {
            "type": "text",
            "text": "# apt_inst (pydoc)\n\n**Summary:** aptinst - Functions for working with ar/tar archives and .deb packages.\n\n## Section Outline\n\n- **NAME** (2 lines)\n- **DESCRIPTION** (3 lines)\n- **CLASSES** (7 lines) — 5 subsections\n  - class ArArchive (77 lines)\n  - class ArMember (33 lines)\n  - class DebFile (98 lines)\n  - class TarFile (46 lines)\n  - class TarMember (67 lines)\n- **FILE** (3 lines)\n\n## Full Content\n\n### NAME\n\naptinst - Functions for working with ar/tar archives and .deb packages.\n\n### DESCRIPTION\n\nThis module provides useful classes and functions to work with\narchives, modelled after the 'TarFile' class in the 'tarfile' module.\n\n### CLASSES\n\nbuiltins.object\nArArchive\nDebFile\nArMember\nTarFile\nTarMember\n\n#### class ArArchive\n\n|  ArArchive(file: str/int/file)\n|\n|  Represent an archive in the 4.4 BSD ar format,\n|  which is used for e.g. deb packages.\n|\n|  The parameter 'file' may be a string specifying the path of a file, or\n|  a file-like object providing the fileno() method. It may also be an int\n|  specifying a file descriptor (returned by e.g. os.open()).\n|  The recommended way of using it is to pass in the path to the file.\n|\n|  Methods defined here:\n|\n|  contains(self, key, /)\n|      Return key in self.\n|\n|  getitem(self, key, /)\n|      Return self[key].\n|\n|  iter(self, /)\n|      Implement iter(self).\n|\n|  extract(...)\n|      extract(name: str[, target: str]) -> bool\n|\n|      Extract the member given by 'name' into the directory given\n|      by 'target'. If the extraction fails, raise OSError. In case\n|      of success, return True if the file owner could be set or\n|      False if this was not possible. If the requested member\n|      does not exist, raise LookupError.\n|\n|  extractall(...)\n|      extractall([target: str]) -> bool\n|\n|      Extract all archive contents into the directory given by 'target'. If\n|      the extraction fails, raise an error. Otherwise, return True if the\n|      owner could be set or False if the owner could not be changed.\n|\n|  extractdata(...)\n|      extractdata(name: str) -> bytes\n|\n|      Return the contents of the member, as a bytes object. Raise\n|      LookupError if there is no ArMember with the given name.\n|\n|  getmember(...)\n|      getmember(name: str) -> ArMember\n|\n|      Return an ArMember object for the member given by 'name'. Raise\n|      LookupError if there is no ArMember with the given name.\n|\n|  getmembers(...)\n|      getmembers() -> list\n|\n|      Return a list of all members in the archive.\n|\n|  getnames(...)\n|      getnames() -> list\n|\n|      Return a list of the names of all members in the archive.\n|\n|  gettar(...)\n|      gettar(name: str, comp: str) -> TarFile\n|\n|      Return a TarFile object for the member given by 'name' which will be\n|      decompressed using the compression algorithm given by 'comp'.\n|      This is almost equal to:\n|\n|         member = arfile.getmember(name)\n|         tarfile = TarFile(file, member.start, member.size, 'gzip')'\n|\n|      It just opens a new TarFile on the given position in the stream.\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 ArMember\n\n|  Represent a single file within an AR archive. For\n|  Debian packages this can be e.g. control.tar.gz. This class provides\n|  information about this file, such as the mode and size.\n|\n|  Methods defined here:\n|\n|  repr(self, /)\n|      Return repr(self).\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors defined here:\n|\n|  gid\n|      The group id of the owner.\n|\n|  mode\n|      The mode of the file.\n|\n|  mtime\n|      Last time of modification.\n|\n|  name\n|      The name of the file.\n|\n|  size\n|      The size of the files.\n|\n|  start\n|      The offset in the archive where the file starts.\n|\n|  uid\n|      The user ID of the owner.\n\n#### class DebFile\n\n|  DebFile(file: str/int/file)\n|\n|  A DebFile object represents a file in the .deb package format.\n|\n|  The parameter 'file' may be a string specifying the path of a file, or\n|  a file-like object providing the fileno() method. It may also be an int\n|  specifying a file descriptor (returned by e.g. os.open()).\n|  The recommended way of using it is to pass in the path to the file.\n|\n|  It differs from ArArchive by providing the members 'control', 'data'\n|  and 'version' for accessing the control.tar.gz, data.tar.$compression\n|  (all apt compression methods are supported), and debian-binary members\n|  in the archive.\n|\n|  Method resolution order:\n|      DebFile\n|      ArArchive\n|      builtins.object\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|  control\n|      The TarFile object associated with the control.tar.gz member.\n|\n|  data\n|      The TarFile object associated with the data.tar.$compression member. All apt compression methods are supported.\n|\n|  debianbinary\n|      The package version, as contained in debian-binary.\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from ArArchive:\n|\n|  contains(self, key, /)\n|      Return key in self.\n|\n|  getitem(self, key, /)\n|      Return self[key].\n|\n|  iter(self, /)\n|      Implement iter(self).\n|\n|  extract(...)\n|      extract(name: str[, target: str]) -> bool\n|\n|      Extract the member given by 'name' into the directory given\n|      by 'target'. If the extraction fails, raise OSError. In case\n|      of success, return True if the file owner could be set or\n|      False if this was not possible. If the requested member\n|      does not exist, raise LookupError.\n|\n|  extractall(...)\n|      extractall([target: str]) -> bool\n|\n|      Extract all archive contents into the directory given by 'target'. If\n|      the extraction fails, raise an error. Otherwise, return True if the\n|      owner could be set or False if the owner could not be changed.\n|\n|  extractdata(...)\n|      extractdata(name: str) -> bytes\n|\n|      Return the contents of the member, as a bytes object. Raise\n|      LookupError if there is no ArMember with the given name.\n|\n|  getmember(...)\n|      getmember(name: str) -> ArMember\n|\n|      Return an ArMember object for the member given by 'name'. Raise\n|      LookupError if there is no ArMember with the given name.\n|\n|  getmembers(...)\n|      getmembers() -> list\n|\n|      Return a list of all members in the archive.\n|\n|  getnames(...)\n|      getnames() -> list\n|\n|      Return a list of the names of all members in the archive.\n|\n|  gettar(...)\n|      gettar(name: str, comp: str) -> TarFile\n|\n|      Return a TarFile object for the member given by 'name' which will be\n|      decompressed using the compression algorithm given by 'comp'.\n|      This is almost equal to:\n|\n|         member = arfile.getmember(name)\n|         tarfile = TarFile(file, member.start, member.size, 'gzip')'\n|\n|      It just opens a new TarFile on the given position in the stream.\n\n#### class TarFile\n\n|  TarFile(file: str/int/file[, min: int, max: int, comp: str])\n|\n|  The parameter 'file' may be a string specifying the path of a file, or\n|  a file-like object providing the fileno() method. It may also be an int\n|  specifying a file descriptor (returned by e.g. os.open()).\n|\n|  The parameter 'min' describes the offset in the file where the archive\n|  begins and the parameter 'max' is the size of the archive.\n|\n|  The compression of the archive is set by the parameter 'comp'. It can\n|  be set to any program supporting the -d switch, the default being gzip.\n|\n|  Methods defined here:\n|\n|  repr(self, /)\n|      Return repr(self).\n|\n|  extractall(...)\n|      extractall([rootdir: str]) -> True\n|\n|      Extract the archive in the current directory. The argument 'rootdir'\n|      can be used to change the target directory.\n|\n|  extractdata(...)\n|      extractdata(member: str) -> bytes\n|\n|      Return the contents of the member, as a bytes object. Raise\n|      LookupError if there is no member with the given name.\n|\n|  go(...)\n|      go(callback: callable[, member: str]) -> True\n|\n|      Go through the archive and call the callable 'callback' for each\n|      member with 2 arguments. The first argument is the TarMember and\n|      the second one is the data, as bytes.\n|\n|      The optional parameter 'member' can be used to specify the member for\n|      which to call the callback. If not specified, it will be called for all\n|      members. If specified and not found, LookupError will be raised.\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 TarMember\n\n|  Represent a single member of a 'tar' archive.\n|\n|  This class, which has been modelled after 'tarfile.TarInfo', represents\n|  information about a given member in an archive.\n|\n|  Methods defined here:\n|\n|  repr(self, /)\n|      Return repr(self).\n|\n|  isblk(...)\n|      Determine whether the member is a block device.\n|\n|  ischr(...)\n|      Determine whether the member is a character device.\n|\n|  isdev(...)\n|      Determine whether the member is a device (block, character or FIFO).\n|\n|  isdir(...)\n|      Determine whether the member is a directory.\n|\n|  isfifo(...)\n|      Determine whether the member is a FIFO.\n|\n|  isfile(...)\n|      Determine whether the member is a regular file.\n|\n|  islnk(...)\n|      Determine whether the member is a hardlink.\n|\n|  isreg(...)\n|      Determine whether the member is a regular file, same as isfile().\n|\n|  issym(...)\n|      Determine whether the member is a symbolic link.\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors defined here:\n|\n|  gid\n|      The owner's group ID.\n|\n|  linkname\n|      The target of the link.\n|\n|  major\n|      The major ID of the device.\n|\n|  minor\n|      The minor ID of the device.\n|\n|  mode\n|      The mode (permissions).\n|\n|  mtime\n|      Last time of modification.\n|\n|  name\n|      The name of the file.\n|\n|  size\n|      The size of the file.\n|\n|  uid\n|      The owner's user ID.\n\n### FILE\n\n/usr/lib/python3/dist-packages/aptinst.cpython-310-x8664-linux-gnu.so\n\n"
        }
    ],
    "structuredContent": {
        "command": "apt_inst",
        "section": "",
        "mode": "pydoc",
        "summary": "aptinst - Functions for working with ar/tar archives and .deb packages.",
        "synopsis": null,
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "CLASSES",
                "lines": 7,
                "subsections": [
                    {
                        "name": "class ArArchive",
                        "lines": 77
                    },
                    {
                        "name": "class ArMember",
                        "lines": 33
                    },
                    {
                        "name": "class DebFile",
                        "lines": 98
                    },
                    {
                        "name": "class TarFile",
                        "lines": 46
                    },
                    {
                        "name": "class TarMember",
                        "lines": 67
                    }
                ]
            },
            {
                "name": "FILE",
                "lines": 3,
                "subsections": []
            }
        ]
    }
}