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 07-30-2021, 10:56 AM   #1
capink
Guru
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: 794
Karma: 211826
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.


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.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:	682
Size:	33.8 KB
ID:	188434   Click image for larger version

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

Name:	3.png
Views:	863
Size:	98.6 KB
ID:	188436  
Attached Files
File Type: zip Category Tags 0.2.7.zip (90.5 KB, 2692 views)

Last edited by capink; 08-10-2022 at 03:16 AM. Reason: Version 0.2.5 released
capink is online now   Reply With Quote
Old 10-22-2021, 11:12 AM   #2
jbacelar
Interested in the matter
jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.
 
jbacelar's Avatar
 
Posts: 401
Karma: 426094
Join Date: Dec 2011
Location: Spain, south coast
Device: Pocketbook InkPad 3
I hope to explain myself more or less, since my English is quite primitive:

Having defined (for example) Naguib Mahfouz (item) authors (item_type) Nationality.Egyptian (categories), how could the value Egyptian be automatically transferred to a user column, for all the books of the author Naguib Mahfouz?
jbacelar is offline   Reply With Quote
Advert
Old 10-23-2021, 02:50 AM   #3
capink
Guru
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: 794
Karma: 211826
Join Date: Aug 2015
Device: Kindle
You can use the template language to populate a custom column with the user categories.

Code:
program:
    user_categories()
You can update the column with calibre's search and replace (which supports using a template as an input field), or by using the Action Chains plugin.

Also, the template language should allow you to control what user categories should be included and what should not. For example, if you want only user categories starting with "Nationality." to be included:

Code:
program:
	res = '';
	for cat in user_categories():
		if '^nationality\.' in cat then
			res = list_union(res, cat, ',')
		fi
	rof;
        res

Last edited by capink; 10-23-2021 at 04:47 AM.
capink is online now   Reply With Quote
Old 10-23-2021, 03:30 AM   #4
jbacelar
Interested in the matter
jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.
 
jbacelar's Avatar
 
Posts: 401
Karma: 426094
Join Date: Dec 2011
Location: Spain, south coast
Device: Pocketbook InkPad 3
Many thanks.
I will try it today.
jbacelar is offline   Reply With Quote
Old 10-23-2021, 01:22 PM   #5
jbacelar
Interested in the matter
jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.
 
jbacelar's Avatar
 
Posts: 401
Karma: 426094
Join Date: Dec 2011
Location: Spain, south coast
Device: Pocketbook InkPad 3
It works great.
jbacelar is offline   Reply With Quote
Advert
Old 10-31-2021, 03:30 AM   #6
jbacelar
Interested in the matter
jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.
 
jbacelar's Avatar
 
Posts: 401
Karma: 426094
Join Date: Dec 2011
Location: Spain, south coast
Device: Pocketbook InkPad 3
After having carried out an import of authors-nationality without any problem, in the second import with new authors this error appears:

Quote:
calibre, version 5.31.1
ERROR: Excepción no considerada: <b>AttributeError</b>:'set' object has no attribute 'append'

calibre 5.31.1 [64bit] embedded-python: True is64bit: True
Windows-10-10.0.19041 Windows ('64bit', 'WindowsPE')
('Windows', '10', '10.0.19041')
Python 3.8.5
Windows: ('10', '10.0.19041', '', 'Multiprocessor Free')
Interface language: es
Successfully initialized third party plugins: DeDRM (7, 2, 1) && Action Chains (1, 13, 3) && Calibre Power Search Plugin (2, 1, 1) && Category Tags (0, 1, 1) && Comments Cleaner (1, 4, 1) && Count Pages (1, 11, 1) && Diaps Editing Toolbag (0, 3, 7) && EpubCheck (0, 2, 3) && EpubMerge (2, 11, 0) && EpubSplit (3, 1, 0) && Favourites Menu (1, 0, 5) && Find Duplicates (1, 8, 10) && GetFileName (0, 1, 1) && Import List (1, 5, 6) && Job Spy (1, 0, 190) && LanguageTool (0, 1, 1) && Modify ePub (1, 6, 3) && Prince PDF (1, 5, 0) && Quality Check (1, 11, 4) && Resize Cover (1, 1, 0) && Search The Internet (1, 8, 1) && TOC View Generator (2, 1, 1) && User Category (1, 5, 5) && View Manager (1, 6, 0)
Traceback (most recent call last):
File "calibre_plugins.category_tags.user_categories.pag e_resolve", line 699, in validatePage
File "calibre_plugins.category_tags.user_categories.act ions", line 115, in add_categories_for_item
AttributeError: 'set' object has no attribute 'append'
jbacelar is offline   Reply With Quote
Old 10-31-2021, 04:24 AM   #7
capink
Guru
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: 794
Karma: 211826
Join Date: Aug 2015
Device: Kindle
Try this and report back, please.

Last edited by capink; 10-31-2021 at 08:39 AM. Reason: zip moved to first post
capink is online now   Reply With Quote
Old 10-31-2021, 04:29 AM   #8
jbacelar
Interested in the matter
jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.
 
jbacelar's Avatar
 
Posts: 401
Karma: 426094
Join Date: Dec 2011
Location: Spain, south coast
Device: Pocketbook InkPad 3
I will do it.
jbacelar is offline   Reply With Quote
Old 10-31-2021, 07:26 AM   #9
jbacelar
Interested in the matter
jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.
 
jbacelar's Avatar
 
Posts: 401
Karma: 426094
Join Date: Dec 2011
Location: Spain, south coast
Device: Pocketbook InkPad 3
It works perfectly.
jbacelar is offline   Reply With Quote
Old 12-17-2021, 12:12 PM   #10
jbacelar
Interested in the matter
jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.
 
jbacelar's Avatar
 
Posts: 401
Karma: 426094
Join Date: Dec 2011
Location: Spain, south coast
Device: Pocketbook InkPad 3
Error

After working without any problem, today trying to import I find the following error:
Code:
calibre, version 5.34.0
ERROR: Excepción no considerada: <b>AttributeError</b>:'list' object has no attribute 'add'

calibre 5.34 [64bit]  embedded-python: True is64bit: True
Windows-10-10.0.19041 Windows ('64bit', 'WindowsPE')
('Windows', '10', '10.0.19041')
Python 3.8.5
Windows: ('10', '10.0.19041', '', 'Multiprocessor Free')
Interface language: es
Successfully initialized third party plugins: DeDRM (7, 2, 1) && Action Chains (1, 14, 0) && Calibre Power Search Plugin (2, 1, 1) && Category Tags (0, 1, 2) && Comments Cleaner (1, 5, 0) && Count Pages (1, 11, 1) && Diaps Editing Toolbag (0, 3, 7) && Editor Chains (0, 4, 1) && EpubCheck (0, 2, 3) && EpubMerge (2, 11, 0) && EpubSplit (3, 1, 0) && Favourites Menu (1, 0, 5) && Find Duplicates (1, 8, 10) && GetFileName (0, 1, 1) && Import List (1, 5, 6) && Job Spy (1, 0, 190) && LanguageTool (0, 1, 1) && Modify ePub (1, 6, 3) && Prince PDF (1, 5, 0) && Quality Check (1, 11, 4) && Resize Cover (1, 1, 0) && Search The Internet (1, 8, 1) && TOC View Generator (2, 1, 1) && User Category (1, 5, 5) && View Manager (1, 6, 0)
Traceback (most recent call last):
  File "calibre_plugins.category_tags.user_categories.page_resolve", line 699, in validatePage
  File "calibre_plugins.category_tags.user_categories.actions", line 115, in add_categories_for_item
AttributeError: 'list' object has no attribute 'add'
The same happens with Calibre 5.33.2
jbacelar is offline   Reply With Quote
Old 12-17-2021, 12:53 PM   #11
capink
Guru
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: 794
Karma: 211826
Join Date: Aug 2015
Device: Kindle
Does this solve the problems for you?

Last edited by capink; 12-17-2021 at 01:14 PM. Reason: remove zip and add it to first post
capink is online now   Reply With Quote
Old 12-17-2021, 01:06 PM   #12
jbacelar
Interested in the matter
jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.jbacelar ought to be getting tired of karma fortunes by now.
 
jbacelar's Avatar
 
Posts: 401
Karma: 426094
Join Date: Dec 2011
Location: Spain, south coast
Device: Pocketbook InkPad 3
Well yes sir! speed and efficiency.
Thanks a lot.
jbacelar is offline   Reply With Quote
Old 01-07-2022, 04:28 AM   #13
capink
Guru
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: 794
Karma: 211826
Join Date: Aug 2015
Device: Kindle
Version 0.2.0

Changes for the upcoming PyQt6.
capink is online now   Reply With Quote
Old 03-06-2022, 11:12 AM   #14
paolino
Junior Member
paolino began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Mar 2022
Device: IPAD
Calibre 5.38

Does it work with the new version 5.38 ?
I have tried to export but I get only a .csv file with :
"item" "item_type" "categories".

My target is to upload a new list of categories for tags to be used for classifying future ebook.

Thanks
P
paolino is offline   Reply With Quote
Old 03-06-2022, 11:31 AM   #15
paolino
Junior Member
paolino began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Mar 2022
Device: IPAD
I have also tried to import a .csv file but I get always the error message:

"name 'os' is not defined"
paolino is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[GUI Plugin] User Category kiwidude Plugins 108 Today 10:10 AM
[GUI Plugin] Save Virtual Libraries To Column (GUI) chaley Plugins 14 04-04-2021 05:25 AM
Category Editor (Tags) - Manage Tags Pachuqismo Library Management 5 03-10-2021 02:19 PM
How to get the selected category in the code of the gui plugin? esvorontsov Development 1 10-03-2015 12:52 AM


All times are GMT -4. The time now is 03:54 PM.


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