A tool to convert EPUBs to AZW3
This script depends on calibre
. On Debian (or Debian-based distributions) this package can be installed via $ apt-get install calibre
.
$ bash run -i input_file.epub -o output_file.azw3
bash clean [-y]
would remove temporary files (untracked files and folders stored in the obp-gen-mobi folder). The script asks for the user's confirmation before removing the files, but if you are running this as part of a script you might want to use the-y
flag to bypass the confirmation.
Clone the repo and build the image with $ docker build . -t openbookpublishers/obp-gen-mobi
.
docker run --rm \
-v /path/to/local.epub:/ebook_automation/epub_file.epub \
-v /path/to/output:/ebook_automation/output \
openbookpublishers/obp-gen-mobi \
bash run -i input_file.epub -o output_file.azw3
The Thoth wrapper stored at ./src/thoth_wrapper.py
would:
- Run the conversion scripts;
- Query the metadata repository to retrieve the ISBN of the edition;
- Add ISBN to the AZW3 file metadata.
Run the container with:
docker run --rm \
--user `id -u`:`id -g` \
-v `pwd`/input/file.epub:/ebook_automation/epub_file.epub \
-v `pwd`/output/obp-gen-mobi:/ebook_automation/output \
openbookpublishers/obp-gen-mobi \
thoth_wrapper.py --doi 10.11647/obp.0275
Pull requests are welcome.