Quote:
Originally Posted by Turtle91
nice!
Do you have access to the individual xhtml/image/css/ncz files so you can read the text into a variable and manipulate with soup/re/etc.???
|
Yes, you can do this, just open and read.
# read text data
text = book.manifest.open("index.xhtml").read()
# read binary data
data = book.manifest.open("cover.png", "rb").read()
Additionally, you can open any of the files in the epub and it will return a file object. You can directly manipulate this file object. If you only change one byte, it will actually change one byte, which is very beneficial for handling very large files.