xmwa / epub2txt

Convert epub file to txt, update to python3.10 and 3.11

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

epub2txt Codacy BadgeCode style: blackLicense: MITPyPI version

Convert epub to txt with additonal utils

Installation

pip install epub2txt
# pip install epub2txt -U  # to upgrade

Usage

From command line

# 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

python code

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)

TODO

  • Extract a single chapter
  • Batch conversion of several epub files

About

Convert epub file to txt, update to python3.10 and 3.11

License:MIT License


Languages

Language:Python 100.0%