Convert epub to txt with additonal utils
pip install epub2txt
# pip install epub2txt -U # to upgrade
- More resilent to mismatched tags
- Added
epub2txt.content_titles
, useful for creating metada when needed
# convert test.epub to test.txt
epub2txt -f test.epub
# browse for epub file, txt file will be in the same directory as the epub file
epub2txt
# show epub book info: title and toc
epub2txt -i
# show more epub book info: title, toc, metadata, spine (list of stuff packed into the epub)
epub2txt -m
# show epub2txt version
epub2txt -V
from epub2txt import epub2txt
# from a url to epub
url = "https://github.com/ffreemt/tmx2epub/raw/master/tests/1.tmx.epub"
res = epub2txt(url)
# from a local epub file
filepath = r"tests\test.epub"
res = epub2txt(filepath)
# output as a list of chapters
ch_list = epub2txt(filepath, outputlist=True)
# chapter titles will be available as epub2txt.content_titles if available
- Batch conversion of several epub files