Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Plugins

Notices

Reply
 
Thread Tools Search this Thread
Old 02-20-2012, 05:18 PM   #1
JimmXinu
Plugin Developer
JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.
 
Posts: 1,780
Karma: 510215
Join Date: Dec 2011
Location: Midwest USA
Device: Nook STR w/Glowlight, Kindle 3g, Droid
[GUI Plugin] EpubMerge

Merging together multiple eBooks together into one eBook seems to be a common request, but there haven't been many tools to do so.

This plugin provides the ability to create new EPUBs by combining the contents of existing (non-DRM) EPUB format eBooks.

The source may be seen, and a Command Line version obtained, from the project home page.

Main Features of EpubMerge Plugin:
  • Select a list of stories in calibre,
  • Order them,
  • Edit the metadata for the new combined eBook, and then,
  • Merge the contents of the EPUBs together into the new eBook, now including cover from metadata if set.
  • UnMerge previously merged epubs if metadata was saved during merge.
  • Configurably able to save the metadata for each merged book for UnMerging later if desired. (Defaults to On.)
  • Configurably able to populate custom columns from source books.
  • Options now stored inside the Library rather than an external JSON file.
  • CLI via calibre-debug --run-plugin
There are a few configurable options: whether or not to insert a Table of Contents entry for each merged book (with it's original TOC nested underneath it), an option to flatten the TOC down to one level only, and including the merged books comments. These options are stored by Library.

Special Notes:
  • Requires Calibre v0.8.57 or later.

Languages:

This plugin has translations for:
  • English
  • French
  • German
  • Portuguese (Brazil)
  • Spanish
  • Swedish
  • Ukrainian

Command Line Interface(CLI)

Calibre offers a command-line interface (CLI) for calling plugins.

This plugin supports that option and allows the user to call the plugin's basic functionality from outside calibre without having to install Python or get the plugin's files separately.

Details:
Spoiler:

Code:
Usage: calibre-debug.exe --run-plugin EpubMerge -- [options] <input epub> [<input epub>...]

Given list of epubs will be merged together into one new epub.


Options:
  -h, --help            show this help message and exit
  -o OUTPUT, --output=OUTPUT
                        Set OUTPUT file, Default: merge.epub
  -t TITLE, --title=TITLE
                        Use TITLE as the metadata title.  Default: '<first
                        epub title> Anthology'
  -d DESC, --description=DESC
                        Use DESC as the metadata description.  Default: '<epub
                        title> by <author>' for each epub.
  -a AUTHOR, --author=AUTHOR
                        Use AUTHOR as a metadata author, multiple authors may
                        be given, Default: <All authors from epubs>
  -g TAG, --tag=TAG     Include TAG as dc:subject tag, multiple tags may be
                        given, Default: None
  -l LANG, --language=LANG
                        Include LANG as dc:language tag, multiple languages
                        may be given, Default: en
  -n, --no-titles-in-toc
                        Default is to put an entry in the TOC for each epub,
                        nesting each epub's chapters under it.
  -f, --flatten-toc     Flatten TOC down to one level only.
  -c COVER, --cover=COVER
                        Path to a jpg to use as cover image.
  -k, --keep-meta       Keep original metadata files in merged epub.  Use for
                        UnMerging.
  -s URL, --source=URL  Include URL as dc:source and
                        dc:identifier(opf:scheme=URL).
  -u, --unmerge         UnMerge an existing epub that was created by merging
                        with --keep-meta.
  -D OUTPUTDIR, --outputdir=OUTPUTDIR
                        Set output directory for unmerge, Default: (current
                        dir)


Installation Steps:
  1. Download the attached zip file and install the plugin/add to context menu or toolbar/restart Calibre as described in the Introduction to plugins thread.

Paypal Donations:
  • If you find this plugin useful please feel free to show your appreciation.

Version History:
Spoiler:

Version 2.0.4 - 18 Nov 2014
Fix for calibre 2.10's changes to how keyboard shortcuts work. Removes unnecessary dynamic menu.

Version 2.0.3 - 23 Sep 2014
New translation for Swedish, courtesy of the volunteers at Transifex.

Version 2.0.2 - 04 Sep 2014
Add Include Books' Comments feature.

Version 2.0.1 - 04 Aug 2014
Don't put 'by <author>' in comment if only one author.

Version 2.0.0 - 23 Jul 2014
Now supporting Qt5 and Calibre 2.0 (currently in beta).
Translations updates to Spanish, French, German and Ukrainian and new translation Portuguese (Brazil), courtesy of the volunteers at Transifex.
Plugin zip file now uncompressed for performance per Kovid's recommendation.

Portuguese (Brazil)
Version 1.3.9 - 02 Jul 2014
Add Ukrainian translations, courtesy of the volunteers at Transifex.
Pretty format XML of generated metadata files.

Version 1.3.8 - 02 Feb 2014
Add German Translation. Thanks, Wolfgang.

Version 1.3.7 - 30 Dec 2013
Add French Translation. Thanks, Ptitprince.

Version 1.3.6 - 18 Aug 2013
Add configuration option to change word 'Anthology' to something else.

Version 1.3.5 - 30 Jul 2013
Add options to average int/float type custom columns on merge.
Add option to configurably attach tags to new merged books.

Version 1.3.4 - 23 May 2013
Fix for poorly formed metadata--ignore item tags outside manifest tag.

Version 1.3.3 - 16 Mar 2013
Move CLI main import into cli_main. Caused problems for some users on install.

Version 1.3.2 - 15 Mar 2013
Add calibre CLI.

Version 1.3.1 - 19 Feb 2013
Add UnMerge and 'Keep Metadata for UnMerge' options.
Expose an API for other plugins (eg FFDL) to call.

Version 1.2.5 - 13 Dec 2012
Allow namespaces in metadata xml.

Version 1.2.4 - 26 Nov 2012
Disable plugin when viewing device, not library.

Version 1.2.3 - 09 Nov 2012
Save PI options properly.

Version 1.2.2 - 23 Sep 2012
Minor fix for first epub missing metadata.
Only show 'by' author in TOC if only one author.
Make custom columns tab scrollable.

Version 1.2.1 - 28 Jul 2012
Allow for old JSON settings with only partial settings.

Version 1.2.0 - 27 Jul 2012
Options now stored inside the Library rather than an external JSON file.

Version 1.1.0 - 21 May 2012
Default cover to first book, add cover from metadata to epub if present.

Version 1.0.4 - 17 Apr 2012
Unquote item hrefs, so %20 becomes space, etc.

Version 1.0.3 - 06 Apr 2012
Improved handling of epubs with present, but empty author.

Version 1.0.2 - 24 Mar 2012
Improved handling of epubs with missing title and/or author.

Version 1.0.1 - 07 Mar 2012
Add configurable options to populate custom columns from source books.

Version 0.0.0 - 20 Feb 2012
Initial version.
Attached Files
File Type: zip EpubMerge.zip (277.7 KB, 447 views)

Last edited by JimmXinu; 11-18-2014 at 06:43 PM. Reason: Update to latest version.
JimmXinu is offline   Reply With Quote
Old 02-20-2012, 06:20 PM   #2
cklls
Zealot
cklls ought to be getting tired of karma fortunes by now.cklls ought to be getting tired of karma fortunes by now.cklls ought to be getting tired of karma fortunes by now.cklls ought to be getting tired of karma fortunes by now.cklls ought to be getting tired of karma fortunes by now.cklls ought to be getting tired of karma fortunes by now.cklls ought to be getting tired of karma fortunes by now.cklls ought to be getting tired of karma fortunes by now.cklls ought to be getting tired of karma fortunes by now.cklls ought to be getting tired of karma fortunes by now.cklls ought to be getting tired of karma fortunes by now.
 
Posts: 139
Karma: 1030058
Join Date: Jul 2010
Location: New England
Device: Nook, EB1150, Pandigital SuperNova Tablet, Samsung Galaxy Tab 2 10.1
Thanks, Jim! Another great tool. This will be a quick-and-dirty way for me to compile all the recipe files I have into one master book. Karma to you!
cklls is offline   Reply With Quote
 
Advertisement
Old 02-20-2012, 10:44 PM   #3
iatheia
Connoisseur
iatheia is as sexy as a twisted cruller doughtnut.iatheia is as sexy as a twisted cruller doughtnut.iatheia is as sexy as a twisted cruller doughtnut.iatheia is as sexy as a twisted cruller doughtnut.iatheia is as sexy as a twisted cruller doughtnut.iatheia is as sexy as a twisted cruller doughtnut.iatheia is as sexy as a twisted cruller doughtnut.iatheia is as sexy as a twisted cruller doughtnut.iatheia is as sexy as a twisted cruller doughtnut.iatheia is as sexy as a twisted cruller doughtnut.iatheia is as sexy as a twisted cruller doughtnut.
 
Posts: 90
Karma: 15316
Join Date: Mar 2011
Device: Kindle 3
Awesome! Will try it out immediately!

Last edited by iatheia; 02-20-2012 at 10:46 PM.
iatheia is offline   Reply With Quote
Old 02-20-2012, 10:50 PM   #4
JimmXinu
Plugin Developer
JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.
 
Posts: 1,780
Karma: 510215
Join Date: Dec 2011
Location: Midwest USA
Device: Nook STR w/Glowlight, Kindle 3g, Droid
Nobody's complained so far, so it must be working.
JimmXinu is offline   Reply With Quote
Old 02-20-2012, 11:07 PM   #5
iatheia
Connoisseur
iatheia is as sexy as a twisted cruller doughtnut.iatheia is as sexy as a twisted cruller doughtnut.iatheia is as sexy as a twisted cruller doughtnut.iatheia is as sexy as a twisted cruller doughtnut.iatheia is as sexy as a twisted cruller doughtnut.iatheia is as sexy as a twisted cruller doughtnut.iatheia is as sexy as a twisted cruller doughtnut.iatheia is as sexy as a twisted cruller doughtnut.iatheia is as sexy as a twisted cruller doughtnut.iatheia is as sexy as a twisted cruller doughtnut.iatheia is as sexy as a twisted cruller doughtnut.
 
Posts: 90
Karma: 15316
Join Date: Mar 2011
Device: Kindle 3
Working great!
The one thing that I would add, though, is options for population of some custom columns, such as category or characters.
iatheia is offline   Reply With Quote
Old 02-20-2012, 11:30 PM   #6
JimmXinu
Plugin Developer
JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.
 
Posts: 1,780
Karma: 510215
Join Date: Dec 2011
Location: Midwest USA
Device: Nook STR w/Glowlight, Kindle 3g, Droid
Populating a custom column on the new book with the values from the same custom column in the source books?

CSV(Tag-like) columns could be doable. I'm not sure what could be done with other column types. I'll think on it.

You can do something similar with "Edit Metadata>Merge book records>Merge into first selected book - keep...". Not ideal, but somewhat works.
JimmXinu is offline   Reply With Quote
Old 02-20-2012, 11:38 PM   #7
iatheia
Connoisseur
iatheia is as sexy as a twisted cruller doughtnut.iatheia is as sexy as a twisted cruller doughtnut.iatheia is as sexy as a twisted cruller doughtnut.iatheia is as sexy as a twisted cruller doughtnut.iatheia is as sexy as a twisted cruller doughtnut.iatheia is as sexy as a twisted cruller doughtnut.iatheia is as sexy as a twisted cruller doughtnut.iatheia is as sexy as a twisted cruller doughtnut.iatheia is as sexy as a twisted cruller doughtnut.iatheia is as sexy as a twisted cruller doughtnut.iatheia is as sexy as a twisted cruller doughtnut.
 
Posts: 90
Karma: 15316
Join Date: Mar 2011
Device: Kindle 3
Yes, something like that.

Perhaps in settings add a tab for the custom columns where one can chose what action to preform? Append for tags, add for numbers, overwrite of the latest date for dates, or use values from the first one in the order?
iatheia is offline   Reply With Quote
Old 02-21-2012, 12:46 AM   #8
JaneD
Addict
JaneD ought to be getting tired of karma fortunes by now.JaneD ought to be getting tired of karma fortunes by now.JaneD ought to be getting tired of karma fortunes by now.JaneD ought to be getting tired of karma fortunes by now.JaneD ought to be getting tired of karma fortunes by now.JaneD ought to be getting tired of karma fortunes by now.JaneD ought to be getting tired of karma fortunes by now.JaneD ought to be getting tired of karma fortunes by now.JaneD ought to be getting tired of karma fortunes by now.JaneD ought to be getting tired of karma fortunes by now.JaneD ought to be getting tired of karma fortunes by now.
 
JaneD's Avatar
 
Posts: 293
Karma: 998895
Join Date: May 2010
Location: LA, CA
Device: Kindle DX, Kindle 3 (Keyboard), Nexus 7 (2013)
I really, really need this plugin. It's like you read my mind.

Can't wait to try it out.
JaneD is offline   Reply With Quote
Old 02-21-2012, 07:09 AM   #9
andyh2000
Fanatic
andyh2000 ought to be getting tired of karma fortunes by now.andyh2000 ought to be getting tired of karma fortunes by now.andyh2000 ought to be getting tired of karma fortunes by now.andyh2000 ought to be getting tired of karma fortunes by now.andyh2000 ought to be getting tired of karma fortunes by now.andyh2000 ought to be getting tired of karma fortunes by now.andyh2000 ought to be getting tired of karma fortunes by now.andyh2000 ought to be getting tired of karma fortunes by now.andyh2000 ought to be getting tired of karma fortunes by now.andyh2000 ought to be getting tired of karma fortunes by now.andyh2000 ought to be getting tired of karma fortunes by now.
 
andyh2000's Avatar
 
Posts: 567
Karma: 1568694
Join Date: Apr 2009
Location: UK
Device: Samsung Galaxy S4 Mini phone / Kindle 4 Black / Kindle Paperwhite
Now that is a very cool plugin - great for making anthologies or pasting together a daily newspaper from different sources. Thanks.

Andrew
andyh2000 is offline   Reply With Quote
Old 02-21-2012, 11:56 PM   #10
Dopedangel
Wizard
Dopedangel ought to be getting tired of karma fortunes by now.Dopedangel ought to be getting tired of karma fortunes by now.Dopedangel ought to be getting tired of karma fortunes by now.Dopedangel ought to be getting tired of karma fortunes by now.Dopedangel ought to be getting tired of karma fortunes by now.Dopedangel ought to be getting tired of karma fortunes by now.Dopedangel ought to be getting tired of karma fortunes by now.Dopedangel ought to be getting tired of karma fortunes by now.Dopedangel ought to be getting tired of karma fortunes by now.Dopedangel ought to be getting tired of karma fortunes by now.Dopedangel ought to be getting tired of karma fortunes by now.
 
Dopedangel's Avatar
 
Posts: 1,123
Karma: 8671315
Join Date: Dec 2006
Location: Singapore
Device: Coolreader(Nexus 5)\Coolreader(Nook Touch)
Is it possible for you to go in reverse and separate one epub to many. Maybe giving the option of selecting the contents from the Toc you want to separate into different books.
I read a lot of series and many authors write short stories for anthologies that are part of a series. Would love to separate them and put them in the correct series order for each.
Dopedangel is offline   Reply With Quote
Old 02-22-2012, 12:34 AM   #11
JimmXinu
Plugin Developer
JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.
 
Posts: 1,780
Karma: 510215
Join Date: Dec 2011
Location: Midwest USA
Device: Nook STR w/Glowlight, Kindle 3g, Droid
Quote:
Originally Posted by Dopedangel View Post
Is it possible for you to go in reverse and separate one epub to many. Maybe giving the option of selecting the contents from the Toc you want to separate into different books.
That would be a lot more challenging. Just some of the issues are:
  • TOC entries can point to anchors inside an xhtml file, not just the start of files, possibly requiring files to be split.
  • More than one TOC entry can point to the same file and/or anchor. (Start of book and first chapter, for example.)
  • Not every xhtml in the epub has to have a TOC entry, so more than one xhtml file may be in the same 'chapter'.
  • Image and CSS links would have to be scanned for so those files would end up in the correct output epubs.
  • Splitting nested TOC entries would be challenging.
  • The TOC and the 'spine' (the order the xhtml files appear) aren't required to be in the same order. I can't think of a good reason why anyone would, but they could.
It's difficult, but not necessarily impossible--now I'm intrigued by the idea just for the symmetry of it.

Right now, I'd probably use Sigil for that--make a copy for the section you want to split off and delete everything else.
JimmXinu is offline   Reply With Quote
Old 02-22-2012, 01:27 AM   #12
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 5,888
Karma: 5704423
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo Touch, Kobo Glo
Quote:
Originally Posted by JimmXinu View Post
  • The TOC and the 'spine' (the order the xhtml files appear) aren't required to be in the same order. I can't think of a good reason why anyone would, but they could.
I hit a couple of epubs like this last week. They were scanned versions of old paperbacks. As well as the front cover, they included images of the back cover and the pages up to the title page. When I read the epub, these were all at the end, but in Sigil they listed in the logical order. It took me a while before I realised how this had been done with the "spine" and "guide".
Quote:
It's difficult, but not necessarily impossible--now I'm intrigued by the idea just for the symmetry of it.
Wasn't that how this plugin came about? Someone asked "Would it be possible to ...?" I would warn you not to fall into that trap, but I think it's to late.

Hmmm..

Split the epub on "H1" (or a selectable header level) and take all files between the H1s, use the contents.opf for each new file but strip out references for files not in the current one and do the same for the TOC. Maybe keep the coverpage all of them? Run the results through the Calibre conversion process to do some clean up... Damn, now you have me doing it
davidfor is offline   Reply With Quote
Old 02-24-2012, 02:25 AM   #13
TMF
Enthusiast
TMF began at the beginning.
 
Posts: 40
Karma: 10
Join Date: May 2009
Device: PRS-505
Wow, that was fast! Thank you very much for this useful plugin!
TMF is offline   Reply With Quote
Old 03-06-2012, 06:47 PM   #14
JimmXinu
Plugin Developer
JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.JimmXinu ought to be getting tired of karma fortunes by now.
 
Posts: 1,780
Karma: 510215
Join Date: Dec 2011
Location: Midwest USA
Device: Nook STR w/Glowlight, Kindle 3g, Droid
@iatheia - When you get a chance, try out this version and see if it does what you were hoping for with custom columns.

Updated with fixes.

Last edited by JimmXinu; 03-23-2012 at 06:07 PM. Reason: Clean up old beta version
JimmXinu is offline   Reply With Quote
Old 03-07-2012, 03:22 PM   #15
iatheia
Connoisseur
iatheia is as sexy as a twisted cruller doughtnut.iatheia is as sexy as a twisted cruller doughtnut.iatheia is as sexy as a twisted cruller doughtnut.iatheia is as sexy as a twisted cruller doughtnut.iatheia is as sexy as a twisted cruller doughtnut.iatheia is as sexy as a twisted cruller doughtnut.iatheia is as sexy as a twisted cruller doughtnut.iatheia is as sexy as a twisted cruller doughtnut.iatheia is as sexy as a twisted cruller doughtnut.iatheia is as sexy as a twisted cruller doughtnut.iatheia is as sexy as a twisted cruller doughtnut.
 
Posts: 90
Karma: 15316
Join Date: Mar 2011
Device: Kindle 3
Something like that, yes =)

Although, "take value from the first/last source book" doesn't seem to be working.
iatheia is offline   Reply With Quote
Reply

Tags
combine books, make collection, merge epub, solved

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[GUI Plugin] FanFictionDownLoader JimmXinu Plugins 3520 11-23-2014 11:31 AM
[GUI Plugin] Open With kiwidude Plugins 250 11-20-2014 03:45 PM
[GUI Plugin] Quick Preferences kiwidude Plugins 32 09-13-2014 11:34 PM
eBookCleaner slobberchopz Plugins 9 02-23-2012 05:25 AM
[GUI Plugin] Plugin Updater **Deprecated** kiwidude Plugins 159 06-19-2011 01:27 PM


All times are GMT -4. The time now is 02:48 AM.


MobileRead.com is a privately owned, operated and funded community.