docs: def from_file(cls, file):
          """Create the object from a *file* or *file-like object*.
          The file can point to an ``.epub`` file or a directory
          (the contents of which reflect
          the internal struture of an ``.epub`` archive).
          If given an non-archive file,
          this structure will be used when reading in and parsing the epub.
          If an archive file is given,
          it will be extracted to the temporal filesystem.
          """
          root = None
          if zipfile.is_zipfile(file):
              unpack_dir = tempfile.mkdtemp('-epub')
              # Extract the epub to the current working directory.
              with zipfile.ZipFile(file, 'r') as zf:
                  zf.extractall(path=unpack_dir)
              root = unpack_dir
          elif os.path.isdir(file):
              root = file
          else:
              raise TypeError("Can't decipher what should be done "
                              "with the given file.")
  
          # NOTE We ignore the mimetype file, as it's not extremely important
          #      to anything done here.
  
          # Build a blank epub object then parse the packages.
          container_xml_filepath = os.path.join(root,
                                                EPUB_CONTAINER_XML_RELATIVE_PATH)
          container_xml = etree.parse(container_xml_filepath)
  
          packages = []
          for pkg_filepath in container_xml.xpath(
                  '//ns:rootfile/@full-path',
                  namespaces=EPUB_CONTAINER_XML_NAMESPACES):
              filepath = os.path.join(root, pkg_filepath)
              packages.append(Package.from_file(filepath))
          return cls(packages=packages, root=root)