{
    "content": [
        {
            "type": "text",
            "text": "# zipimport (pydoc)\n\n**Summary:** zipimport - zipimport provides support for importing Python modules from Zip archives.\n\n## Section Outline\n\n- **NAME** (2 lines)\n- **MODULE REFERENCE** (8 lines)\n- **DESCRIPTION** (11 lines)\n- **CLASSES** (5 lines) — 2 subsections\n  - class ZipImportError (80 lines)\n  - class zipimporter (123 lines)\n- **DATA** (2 lines)\n- **FILE** (3 lines)\n\n## Full Content\n\n### NAME\n\nzipimport - zipimport provides support for importing Python modules from Zip archives.\n\n### MODULE REFERENCE\n\nhttps://docs.python.org/3.10/library/zipimport.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 exports three objects:\n- zipimporter: a class; its constructor takes a path to a Zip archive.\n- ZipImportError: exception raised by zipimporter objects. It's a\nsubclass of ImportError, so it can be caught as ImportError, too.\n- zipdirectorycache: a dict, mapping archive paths to zip directory\ninfo dicts, as used in zipimporter.files.\n\nIt is usually not needed to use the zipimport module explicitly; it is\nused by the builtin import mechanism for sys.path items that are paths\nto Zip archives.\n\n### CLASSES\n\nfrozenimportlibexternal.LoaderBasics(builtins.object)\nzipimporter\nbuiltins.ImportError(builtins.Exception)\nZipImportError\n\n#### class ZipImportError\n\n|  Method resolution order:\n|      ZipImportError\n|      builtins.ImportError\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.ImportError:\n|\n|  init(self, /, *args, kwargs)\n|      Initialize self.  See help(type(self)) for accurate signature.\n|\n|  reduce(...)\n|      Helper for pickle.\n|\n|  str(self, /)\n|      Return str(self).\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors inherited from builtins.ImportError:\n|\n|  msg\n|      exception message\n|\n|  name\n|      module name\n|\n|  path\n|      module path\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|  repr(self, /)\n|      Return repr(self).\n|\n|  setattr(self, name, value, /)\n|      Implement setattr(self, name, value).\n|\n|  setstate(...)\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 zipimporter\n\n|  zipimporter(path)\n|\n|  zipimporter(archivepath) -> zipimporter object\n|\n|  Create a new zipimporter instance. 'archivepath' must be a path to\n|  a zipfile, or to a specific path inside a zipfile. For example, it can be\n|  '/tmp/myimport.zip', or '/tmp/myimport.zip/mydirectory', if mydirectory is a\n|  valid directory inside the archive.\n|\n|  'ZipImportError is raised if 'archivepath' doesn't point to a valid Zip\n|  archive.\n|\n|  The 'archive' attribute of zipimporter objects contains the name of the\n|  zipfile targeted.\n|\n|  Method resolution order:\n|      zipimporter\n|      frozenimportlibexternal.LoaderBasics\n|      builtins.object\n|\n|  Methods defined here:\n|\n|  init(self, path)\n|      Initialize self.  See help(type(self)) for accurate signature.\n|\n|  repr(self)\n|      Return repr(self).\n|\n|  findloader(self, fullname, path=None)\n|      findloader(fullname, path=None) -> self, str or None.\n|\n|      Search for a module specified by 'fullname'. 'fullname' must be the\n|      fully qualified (dotted) module name. It returns the zipimporter\n|      instance itself if the module was found, a string containing the\n|      full path name if it's possibly a portion of a namespace package,\n|      or None otherwise. The optional 'path' argument is ignored -- it's\n|      there for compatibility with the importer protocol.\n|\n|      Deprecated since Python 3.10. Use findspec() instead.\n|\n|  findmodule(self, fullname, path=None)\n|      findmodule(fullname, path=None) -> self or None.\n|\n|      Search for a module specified by 'fullname'. 'fullname' must be the\n|      fully qualified (dotted) module name. It returns the zipimporter\n|      instance itself if the module was found, or None if it wasn't.\n|      The optional 'path' argument is ignored -- it's there for compatibility\n|      with the importer protocol.\n|\n|      Deprecated since Python 3.10. Use findspec() instead.\n|\n|  findspec(self, fullname, target=None)\n|      Create a ModuleSpec for the specified module.\n|\n|      Returns None if the module cannot be found.\n|\n|  getcode(self, fullname)\n|      getcode(fullname) -> code object.\n|\n|      Return the code object for the specified module. Raise ZipImportError\n|      if the module couldn't be imported.\n|\n|  getdata(self, pathname)\n|      getdata(pathname) -> string with file data.\n|\n|      Return the data associated with 'pathname'. Raise OSError if\n|      the file wasn't found.\n|\n|  getfilename(self, fullname)\n|      getfilename(fullname) -> filename string.\n|\n|      Return the filename for the specified module or raise ZipImportError\n|      if it couldn't be imported.\n|\n|  getresourcereader(self, fullname)\n|      Return the ResourceReader for a package in a zip file.\n|\n|      If 'fullname' is a package within the zip file, return the\n|      'ResourceReader' object for the package.  Otherwise return None.\n|\n|  getsource(self, fullname)\n|      getsource(fullname) -> source string.\n|\n|      Return the source code for the specified module. Raise ZipImportError\n|      if the module couldn't be found, return None if the archive does\n|      contain the module, but has no source for it.\n|\n|  invalidatecaches(self)\n|      Reload the file data of the archive path.\n|\n|  ispackage(self, fullname)\n|      ispackage(fullname) -> bool.\n|\n|      Return True if the module specified by fullname is a package.\n|      Raise ZipImportError if the module couldn't be found.\n|\n|  loadmodule(self, fullname)\n|      loadmodule(fullname) -> module.\n|\n|      Load the module specified by 'fullname'. 'fullname' must be the\n|      fully qualified (dotted) module name. It returns the imported\n|      module, or raises ZipImportError if it could not be imported.\n|\n|      Deprecated since Python 3.10. Use execmodule() instead.\n|\n|  ----------------------------------------------------------------------\n|  Methods inherited from frozenimportlibexternal.LoaderBasics:\n|\n|  createmodule(self, spec)\n|      Use default semantics for module creation.\n|\n|  execmodule(self, module)\n|      Execute the module.\n|\n|  ----------------------------------------------------------------------\n|  Data descriptors inherited from frozenimportlibexternal.LoaderBasics:\n|\n|  dict\n|      dictionary for instance variables (if defined)\n|\n|  weakref\n|      list of weak references to the object (if defined)\n\n### DATA\n\nall = ['ZipImportError', 'zipimporter']\n\n### FILE\n\n(built-in)\n\n"
        }
    ],
    "structuredContent": {
        "command": "zipimport",
        "section": "",
        "mode": "pydoc",
        "summary": "zipimport - zipimport provides support for importing Python modules from Zip archives.",
        "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": "DESCRIPTION",
                "lines": 11,
                "subsections": []
            },
            {
                "name": "CLASSES",
                "lines": 5,
                "subsections": [
                    {
                        "name": "class ZipImportError",
                        "lines": 80
                    },
                    {
                        "name": "class zipimporter",
                        "lines": 123
                    }
                ]
            },
            {
                "name": "DATA",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "FILE",
                "lines": 3,
                "subsections": []
            }
        ]
    }
}