code: def download_and_extract_to_mkdtemp(bucket, key, session=None):
      
      if session:
          s3_client = session.client('s3')
      else:
          s3_client = boto3.client('s3')
      transfer = S3Transfer(s3_client)
  
      filedes, temp_file = tempfile.mkstemp()
      os.close(filedes)
      transfer.download_file(bucket, key, temp_file)
  
      output_dir = tempfile.mkdtemp()
      zip_ref = zipfile.ZipFile(temp_file, 'r')
      zip_ref.extractall(output_dir)
      zip_ref.close()
      os.remove(temp_file)
      return output_dir
docs: Download zip archive and extract it to temporary directory.