View Single Post
Old 07-30-2021, 10:56 AM   #1
capink
Wizard
capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.
 
Posts: 1,200
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
[GUI Plugin] Category Tags

The main idea of this plugin is to enable the users to tag items (authors, tags, series, publisher ... etc) in the same way they can tag the books, by making use of user categories. There are two ways to do this in the plugin:
  1. The plugin offers a dialog based on calibre's tag editor that enables you to tag items the same way you tag books. (see attached screenshot)

    The dialog is accessed by right clicking on an item in calibre's tag browser and choosing the category tags action. The plugin will apply the user categories to the selected item. If the user category is not present in calibre it will created by the plugin, this also applies to hierarchical.
  2. The plugin offers import/export functionality that enables mass tagging of items as well as transferring user categories between libraries. More on this below.


Import/Export user categories
  • The plugin offers import/export functionality. This allows the user to export his user categories into csv file, edit them as he wants, and re-import them back again into calibre
  • In the csv file you can tag your items (authors, series, tags, .... etc) with whatever user categories you want.
  • The action currently offers two different csv formats:
    1. The first format is "Items for category". This format allows you to apply a certain tag (i.e user category) for multiple items at once. Say for example you have a list of Nobel Laureates and want to use it to create a user category "Awards.Nobel", this is illustrated below

      Code:
      ---------------------------------------------------------------------------------------------------
      category            item_type           items
      ---------------------------------------------------------------------------------------------------
      Awards.Nobel        authors             Gabriel Garcia Marquez & Naguib Mahfouz & ....
      Genre.Fantasy       series              discworld ::: Wheel of Time ::: .....

      Quote:
      Note: when using "Items for category" format, you should use the following to separate different items:
      • "&" for authors and author like columns.
      • ", " for tags and tag-like columns.
      • ":::" for series and text columns.
    2. The Second format is "Categories for item". This format allows you to apply a multiple tags (i.e user categories) to an item as illustrated below:

      Code:
      ---------------------------------------------------------------------------------------------------
      item                        item_type           categories
      ---------------------------------------------------------------------------------------------------
      Naguib Mahfouz              authors             Awards.Nobel, Nationality.Egyptian, .....
      Gabriel Garcia Marquez      authors             Awards.Nobel, Nationality.Colombian, .....
  • The plugin will create the categories for you even if they are not already in calibre.
  • The items (authors, series, ... etc) in the csv file are matched to items in your calibre library based on criteria you define. By default, identical matching (case insensitive) is used. But you can configure different match criteria for each item_type. Matching is based on advanced mode of the Find Duplicates plugin, so you have the option to choose from: similar, fuzzy, soundex as well as custom match algorithms by using template match.
  • After the items are matched, a dialog for manual match resolution is popped up to allow the user to modify any matches. It is based on code from the Import List plugin (Thanks to kiwidude for his awesome code).
  • The default for items that have multiple matches (e.g Gabriel Garcia Marquez, Gabriel García Márquez) is to apply the categories to all the matches. There is an option to turn this off.
  • As of version 0.3.0, you can export/import both links and notes, only for categories_for_item format.


Credits
  • User category editor is based on calibre's Tag Editor by Kovid Goyal.
  • The manual resolution wizard page is based on code from the Import List plugin by kiwidude.
  • Special thanks for chaley and Kovid for adding the code that add plugins to the tag browser context menu.

Installation Notes:
Special Notes:
  • Requires Calibre 5.24.0 or later.

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

Version History:
Spoiler:

Version 0.3.2 - 12 March 2025
Fix: When applying user categories, make sure to do case insensitive match with existing user categories, to prevent case clashes leading to renames. (Error: found user category case overlap ..., Renaming user category ...)

Version 0.3.1 - 11 March 2025
Fix: Minor Fix.

Version 0.3.0 - 9 March 2025
Update: Add the ability to import/export both links and notes, only applicable for categories_for_items format.

Version 0.2.8 - 19 July 2023
Update: Update to latest Action Chains API.

Version 0.2.7 - 9 August 2022
Update: update to calibre6 icon fetching. Code from @JimmXinu.

Version 0.2.6 - 17 July 2022
Fix PyQt6 migration bugs.

Version 0.2.5 - 18 June 2022
Fix: remove stale db reference.

Version 0.2.4 - 27 April 2022
Fix bug affecting users on Windows.

Version 0.2.3 - 10 February 2022
Fix PyQt6 migration bug.

Version 0.2.2 - 13 January 2022
Fix PyQt6 migration bug.

Version 0.2.1 - 7 January 2022
Fix PyQt6 migration bug.

Version 0.2.0 - 6 January 2022
Changes for the upcoming PyQt6.

Version 0.1.3 - 17 December 2021
Minor fix.

Version 0.1.2 - 31 October 2021
Minor fix.

Version 0.1.1 - 2 August 2021
Minor Bug fixes.

Version 0.1.0 - 2 July 2021
Initial Release.
Attached Thumbnails
Click image for larger version

Name:	1.png
Views:	1609
Size:	33.8 KB
ID:	188434   Click image for larger version

Name:	2.png
Views:	2206
Size:	124.4 KB
ID:	188435   Click image for larger version

Name:	3.png
Views:	2051
Size:	98.6 KB
ID:	188436  
Attached Files
File Type: zip Category Tags_0.3.2.zip (334.7 KB, 7518 views)

Last edited by capink; 03-12-2025 at 04:44 PM. Reason: Version 0.3.2 released
capink is offline   Reply With Quote