View Single Post
Old 11-22-2012, 06:55 PM   #311
kiwidude
Calibre Plugins Developer
kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.
 
Posts: 4,637
Karma: 2162064
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
v1.3.5 Released

Changes in this release:
  • Add a separate me.py script to allow Modify ePub to be run from the command line. Unzip it and refer to the script for help on how to use it.
  • Change to ensure when running via command line the lack of an opf file allows plugin to still run.

I know there are at least a few users out there who put calibre in their workflow only in order to run this plugin to make use of some feature such as removing non DC: metadata or smarten punctuation.

I have bundled in the plugin zip file in a commandline subfolder a python script that can be used from the command line to run almost all of the features of this plugin. There are details on the first post of this thread, a readme.txt inside the zip file, an example batch file and more documentation inside the script itself which can also be viewed.

So after extracting the me.py file from the zip, to see the help:
Code:
calibre-debug -e me.py --help
Example of overwriting an epub in place doing an add/replace of the cover image:
Code:
calibre-debug -e me.py foo.epub --insert_replace_cover "cover.jpg"
Example of smartening punctuation and removing javascript from foo.epub and writing into a new bar.epub:
Code:
calibre-debug -e me.py foo.epub bar.epub --smarten_punctuation --remove_javascript
The two functions you *cannot* do from the command line are:
  1. Add/replace jacket (since it requires calibre metadata, which the point of the command line argument is to avoid adding to calibre)
  2. Update metadata (same as above)
kiwidude is offline   Reply With Quote