import tarfile


def extract_tarfile(file, targetdir):
    """
    Extracts .tar.gz "file" to "targetdir"
    :param file: .tar.gz file
    :param targetdir: target directory
    :return: bool for sucess
    """
    try:
        with tarfile.open(file) as tarobj:
            tarobj.extractall(path=targetdir)
    except tarfile.ReadError as e:
        print('*** Could not extract tarfile ***')
        print('***', e, '***')
        return False
    return True