from calibre.utils.wordcount import get_wordcount_obj book_text = _read_epub_contents(iterator, strip_html=True) wordcount = get_wordcount_obj(book_text)