This plugin updates a new custom column for the total number of books written by each author. This is done for every book in your library. It provides functionality that standard Calibre does not provide, specifically the ability to search using queries constructed with integers for an integer custom column. Example: ((#abc_numeric:">6") and (#abc_numeric:"<47")). Also, its normal ABC column in the Tag Browser has full Tag Browser functionality based specifically on ABC.

Also see: "Author Book Count Hierarchy", a plugin designed for perusing complex Co-Author relationships, not just ABC counts.

Main Features ABC:

This plugin updates a custom column for the total number of books for an author for each book of each author in your library. It always updates all books in the open library. The results are displayed in the left browser pane under "ABC". A menu selection to "Read Instructions" is available.

Installation Notes:

Calibre > Preferences > Custom Columns > Add a new custom column called "author_book_count" with a title of "ABC" and with the default "text, with column shown in the tag browser". Uncheck the new column to hide it. Save your work and restart Calibre. Refer to the attached configuration image file.

Calibre > Preferences > Toolbar > Main Menu Toolbar and then add the icon for Author Book Count. Save your work. Close the window.

If you don't want to see the count in the Book Details view, go to Calibre > Preferences > Look and Feel > Book Details and customize the view to your taste.

The Calibre tag-browser defaults to sorting by Text instead of by Numbers within Text. To change this: Calibre > Preferences > Tweaks > Recognize Numbers Within Text When Sorting > and set numeric_collation = True. See the attached image file for reference.

Optionally, you may create a second new custom column called “abc_numeric”. Choose the type as “integer”. This custom
column will be populated with the integer version of author_book_count, but only if the column exists. Search criteria valid only for integers would then be possible, such as: #abc_numeric:">7"

Execution Notes:

Click the icon for Author Book Count. Agree to continue, and it will execute. It has been optimized for speed, so it is very fast.

You should not be running any other jobs when you run ABC. It is very fast, averaging in testing ~1 second per ~1,000 ebooks.

Special Notes:

Requires Calibre version 1.48.0 or later.

Bear in mind that a single book has a single author book count, so anthologies with a dozen authors will show the count for the author that has the lowest Calibre author id, which is to say the author that was first added to Calibre. If you see a discrepancy between the tag browser for ABC and the books shown in the window, simply right click one of their books and then > Similar Books > Books by Same Author. You should then see the books for which that author was one of multiple authors, and was not the first author listed in the list of authors. This behavior is not a bug, but rather the nature of having only a single value for a single custom column for a single book in Calibre. The count is correct, but the browser pane info on the left of the main gui has to be interpreted properly for books with multiple authors.

Remember to back up your metadata.db file(s) not infrequently, and especially before starting Installation Step 1, above.

This plugin does not update any ebooks or "real" metadata other than the linked new custom column that you defined in Installation Step 1, above.

This plugin can be safely and simply uninstalled and the custom column and associated custom column data deleted via Preferences > Plugins > Remove and also Preferences > Custom Columns > Delete if you so desire.

It is advisable to compact your Calibre metadata.db database periodically. The menu path is Calibre > Library > Library Maintenance > Check Library. It will perform a SQLite Vacuum operation to condense/compact/defrag the database. Example before and after a Vacuum:

Of course, it would be nice if you could account for multiple authors.
Aren't you essentially collecting this information anyway? Since ABC is a single text field, can't you just list counts for authors in order of id, separated by commas, e. g. Mikado, Rogers & Hammerstein, ABC= "7, 9" => "Rogers, Hammerstein"?

Of course, I ask out of ignorance, as I am not a programmer, and haven't the slightest idea how you are doing the counting, and perhaps it would necessitate a few additional passes, thereby taking a bit longer, but it seems to be fast enough anyway.

Steps:
list individual authors
assign a count to each, including wherever they appear
for each book, assemble ABC value by stringing together values for each authors in order.

Is that much different than what you do now?

Any, nice plugin. It has come in quite handy. If the ABC were clickable in the book details, that would be a plus, of course...

The instructions tell you how to customize Calibre for Book Details: "If you don't want to see the count in the Book Details view, go to Calibre > Preferences > Look and Feel > Book Details and customize the view to your taste." You must have turned it off, because the default is "on".

This plugin handles only the first author for the single custom column, which is ""text, with column shown in the tag browser". Adding multiple author counts in the existing column would be confusing to the user, to say the least. After I finish building another new plugin, I will think about adding an optional second new custom_column to deal with multiple authors in such a way that it will be intuitive to use.

No, it seems to be working. It is "on". I probably wasn't being clear...unless, did something say make you think it's not working as it should?

Quote:

Adding multiple author counts in the existing column would be confusing to the user, to say the least.

It would be clearer for users like myself, cause we would see the parity between authors and the values and understood it right away. Now is what's confusing for us; I got all mixed up enough to suggest changing it.

I'll point out that not all users will have come to the forum and read your instructions first, clear as they are. Many of us install from within Calibre, and don't see the special directions til after we install it. I installed the plugin, it didn't work, naturally, and left it at that for a long time til on a whim I tried again when I had a little time to spare. Others might not have.

Quote:

I will think about adding an optional second new custom_column to deal with multiple authors in such a way that it will be intuitive to use.

Whatever you do, it's a nice plugin, so thanks. If you do go ahead, I'll get my two cents in now while the getting is good :

comma separated hyperlinked values, with tooltips indicating which author, and clickable individually for each author. Simple and intuitive. You very likely have better ideas, but I'd settle for that. On the other hand, this may be impossible under whatever limitations calibre's API has, so I'll just share my dream and let it all go....

Author Book Count Release 1.1.0 is now available. It has an Adobe Acrobat .pdf instruction file linked to a sub-menu of the main icon. The instruction file is also attached to the primary post of this thread. Technical changes for the upcoming Calibre 2.0 release were also implemented.

The reason there is a .pdf file attached to this thread is that the Forum Rules disallow any zip attachments except for the PI itself in order to not confuse the scraper that automatically updates the PI Index.

A .pdf file is a single file, and does not need to be zipped. Neither do .rtf or .docx documents, for that matter.

When I converted the original MS Word document in which I wrote the instructions into HTML, multiple files were produced due to the images contained in the instructions. I cannot zip them per the Forum Rules. So, I converted my MS Word document to .pdf instead. Hence the attached .pdf file.

I did try converting the Word docx into a single-file .mht format that could simply be attached to this thread, but the result was a 1.1 megabyte .mht file instead of a 292KB .pdf file.

Within the PI itself, I could certainly use HTML instead of .pdf, since I can extract the HTML files just as I do the .pdf file when the user clicks on the "read instructions" sub-menu icon. It just seems like punishment to have to have 2 different formats because I cannot add an "HTML_Instructions.zip" file to this thread.

I am working on a new plugin that has an 18 page Word document filled with screen snippets and Powerpoint graphics. That PI has the same issue as this one. Also, I hope the Forum Rules concerning max-size of attachments is not bumped against for that PI, since even as a .pdf (and not .mht) it still will be over 1mb in size.

Regarding your suggestion to embed the viewer in the gui, I launch the instructions file (in both plugins) in a sub-process of the operating system that is independent of Calibre so that the instructions can be read even if Calibre is exited. That is why it is not embedded in the gui per you suggestion. Again, my decision was not arbitrary.

Attaching Dozens of Images to OP Because Only 1 Zip Allowed by Forum Rules ???

You suggestion to attach the images to the OP and not make them available within the PI itself is not scalable at all to larger and more complex PIs that have large instruction manuals. My upcoming PI has dozens of images embedded within text, and they form a cohesive whole. Uploading them per your suggestion and expecting the users to download all of them, and then rearrange them in logical sequence, and then read them in the exact sequence they are intended to be read in, would be wishful thinking, and also quite abusive to the users themselves.

You opinion "I doubt anyone needs to view the PI help outside of Calibre" implicitly contradicts your first post that "PDF is a horrible format which invariably invokes laggy viewers". The instructions require the new users of the PI to Restart Calibre two (2) times, because there is a Custom Column involved. If the instructions were not a sub-process of the operating system, they would be closed when Calibre restarted. The user would suffer "lagginess" unnecessarily because the instructions would have to be reopened ("with lagginess") after Calibre restarted. That is not true for using an external viewer that is independent of Calibre, and remains open while Calibre restarts.

You opinion "I doubt anyone needs to view the PI help outside of Calibre" also is flatly incorrect when it comes to more complex PIs that involve the use of other PC tools (such as MS Excel or OpenOffice Calc or Google Docs) simultaneously with the perusal of the instructions. Calibre may not even be running for long periods of time when they need to perform PI-related tasks outside of Calibre.

In short, your comments and suggestions are either (a) not scalable to more complex PIs with more complex instructions; or (b) impractical; or (c) abusive to the users.

Again, my decisions about the instructions were not at all arbitrary or capricious or based on speculation or "doubts". The root criterion that forced the .pdf instruction file format is the Forum Rule about multiple zip files in the Original Post.

If the Forum Admins ever change that Rule, I will then convert all of my MS Word instructions into HTML rather than Adobe's Portable Document Format.

Regardless of the format, the viewer will be an external sub-process to Calibre for the reasons cited above. It might even be Calibre's ebook Viewer itself, which of course is an external sub-process to Calibre, and remains open when Calibre closes, as it should.

I've been trying to give this a whirl and it works as intended however now that I have results I am not able to perform any numeric searches on the column. For example if I use #author_book_count:5, I of course get results with all that have a 5 in the column. If I try to search #author_book_count:>=5, I get nothing. Is there some change I have to make in Calibre in order for this to allow me to search based on numbers?? Does this make sense to you?

I've been trying to give this a whirl and it works as intended however now that I have results I am not able to perform any numeric searches on the column. For example if I use #author_book_count:5, I of course get results with all that have a 5 in the column. If I try to search #author_book_count:>=5, I get nothing. Is there some change I have to make in Calibre in order for this to allow me to search based on numbers?? Does this make sense to you?

ABC was designed to be used from the Tag Browser, not through searching. The column should be hidden as stated in the instructions, and the type of column should be as shown in the example in the instructions. ABC actually is not an integer; it is text. That is why the instructions indicate the need to change the Tweaks within Preferences to sort text as numeric so it sorts properly.

The very fast and easy way to get your results is not through searching, but by CNTL + double-clicking each of the ABC subgroups in the Tag Browser from 1 through 4 so they have a red minus sign. The search bar will automatically be populated with "not #author_book_count:"=1" and not #author_book_count:"=2" and not #author_book_count:"=3" and not #author_book_count:"=4" and not #author_book_count:"=5"". (Be sure your Search Type option is set to "all of the items", and not "any of the items"). You can then save the search, or press CTL+* to create a Virtual Library.