evidentpoint / Organize_Filestructure

Utility programs for organizing files on the Evident Point FTP server.
0 stars 0 forks source link

Assuming the path of an EPUB's Package Document OPF #1

Open jccr opened 4 years ago

jccr commented 4 years ago

Great stuff! Maybe I can help with this: https://github.com/bensmus/Organize_Filestructure/blob/a4e8edf9c5e1b81c19175adf532bf0aaf4d4d4fa/isbn_filestructure.py#L72

To get the concrete path to an EPUB's OPF file (The Package Document) you can parse the META-INF/container.xml file.

Here's an example taken from here:

<?xml version="1.0"?>
<container version="1.0" xmlns="urn:oasis:names:tc:opendocument:xmlns:container">
    <rootfiles>
        <rootfile full-path="OEBPS/As You Like It.opf"
            media-type="application/oebps-package+xml" />
    </rootfiles>
</container>

Specifically the container>rootfiles>rootfile[full-path] node & attribute.

bensmus commented 4 years ago

Thanks, I will definitely update!