def extract(self, archive_path, output_package_path, **kwargs):
force = kwargs.pop('<STR_LIT>', ArchiveDefaultOptions.force)<EOL>if len(kwargs) > <NUM_LIT:0>:<EOL><INDENT>raise Exception("<STR_LIT>" % kwargs)<EOL><DEDENT>logging.info("<STR_LIT>" % (output_package_path, archive_path))<EOL>archive = os.path.abspath(archive_path)<EOL>output = os.path.abspath(output_package_path)<EOL>self._setup_output(output, force)<EOL>with tempdir.in_tempdir():<EOL><INDENT>with tarfile.open(archive) as tar:<EOL><INDENT>tar.extractall()<EOL>for tarinfo in tar:<EOL><INDENT>folder = os.path.dirname(tarinfo.name)<EOL>break<EOL><DEDENT><DEDENT>gpkg = GraftMPackage.acquire(folder)<EOL>if gpkg.version != <NUM_LIT:3>:<EOL><INDENT>raise Exception("<STR_LIT>" % gpkg.version)<EOL><DEDENT>if gpkg.diamond_database_path():<EOL><INDENT>logging.debug("<STR_LIT>")<EOL>gpkg.create_diamond_db()<EOL><DEDENT>shutil.move(folder, output)<EOL><DEDENT>logging.info("<STR_LIT>")<EOL>
Extract an archived GraftM package.

        Parameters
        ----------
        archive_path: str
            path to archive
        output_package_path: str
            path to where to put the extracted file
        kwargs:
            force: bool
                overwrite an existing directory