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 12-14-2019, 10:41 AM   #1
Pr.BarnArt
Addict
Pr.BarnArt ought to be getting tired of karma fortunes by now.Pr.BarnArt ought to be getting tired of karma fortunes by now.Pr.BarnArt ought to be getting tired of karma fortunes by now.Pr.BarnArt ought to be getting tired of karma fortunes by now.Pr.BarnArt ought to be getting tired of karma fortunes by now.Pr.BarnArt ought to be getting tired of karma fortunes by now.Pr.BarnArt ought to be getting tired of karma fortunes by now.Pr.BarnArt ought to be getting tired of karma fortunes by now.Pr.BarnArt ought to be getting tired of karma fortunes by now.Pr.BarnArt ought to be getting tired of karma fortunes by now.Pr.BarnArt ought to be getting tired of karma fortunes by now.
 
Pr.BarnArt's Avatar
 
Posts: 334
Karma: 400746
Join Date: Jun 2011
Device: Pocketbook 902 / Ipad air/ kindle paperwhite
[GUI Plugin] Float Rating (F_rating)

There were several who asked for a plugin which can get and store the decimal rating of goodreads.
I gave it a try, just because I like to tackle a problem. But I am not a very good programmer. So this is more or less for fun and there sure will be better/smarter ways to solve this.

For this you need two plugins:

1. Goodreads_rating
You can find it here or download it within calibre->preferences->plugins.

and
2. F_rating

At the main menu you see the option frating with an ugly icon and a menu.
The menu has two options
a. Set decimal rating.
This function will first check if the column exists, if not it will be created ( and you have to restart Calibre - see dialog-info when this happens).
If the column exists, the function will search for all the records with '#PrB.rating#' in the publisher field.
It will split those publisher-fields into publisher and rating,
The last item is placed in a custom column: gr_ratings
The separator '#PrB.rating#' will be deleted
In the publisher-field remains just the publisher's name.
Direct clicking the ugly icon, starts also this function.

b. Check and create custom column.
There will be info with the results of the check.
If the column is created you have to restart calibre.

Custom column
You can also create the custom column by the gui, use the next values.
Only the text of the label can be of your own choise.•name: gr1
•label: gr_ratings
•type: decimal or float

INSTALLATION (Thanks to arialvetica)

1. Download both linked plugins (current version is always at the bottom of the original post).
2. Install both linked plugins. To do this, click on "Preferences," then under the "Advanced" heading click on "Plugins." For each plugin, click on "Load plugin from file." Find the ZIP file you just downloaded, click "Open." Click "Yes" on the "Are you sure?" dialogue. Restart calibre after installing plugins.
3. There will be a new icon (looks like an orange starburst) in the main menu, called Frating. It has a menu with two options:
- Set decimal rating;
- Check and create custum column;

But you can also click the icon itself and it will run: set decimal rating;
This will check if there is already a custom column for this.
If not it wil create one and you have to restart calibre.
If the check is true, it will go on with putting the decimal rating in the custom column.

For creating the column you can also select the menu option: "Check and create custom column." (Optional: You can change the Column Heading through Preferences: Add Your Own Columns. Double-click on the #gr1 column, and type whatever you prefer in the "Column Heading" field. Do NOT change the lookup name.)


USAGE


To download ratings for an individual book (good for checking if you've done setup correctly.)
1. Click on a book title in the main calibre window.
2. Click on "Edit metadata individually".
3. Next to "Download metadata," click on the Configure Download icon (looks like a "Preferences/Settings" icon, hover-text should read "Change how calibre downloads metadata.")
4. Ensure "Goodreads_Rating" is the ONLY checked Source, then Apply changes.
5. Click on "Download metadata".
6. When the download is complete, click "OK" first for the metadata, then "OK" again for the cover.
7. Click "OK" again to save changes and close the Edit Metadata window.
8. Click on the "Run frating" icon (looks like an orange starburst).
After this processes, you'll see a dialogue box either confirming whether it worked ("Finished extracting rating from publisherfield - for a total of X books") or not ("Finished extracting rating from publisherfield - for a total of 0 books"). Click OK to close the dialogue. Now, in the main calibre window, in this book's row and under the gr_ratings column, you should see a number ranging from 0.0 to 5.0.

To download ratings in bulk
1. Select a range of books in the main calibre window.
2. Click on "Download metadata and covers".
3. Click on "Configure Download".
4. Ensure "Goodreads_Rating" is the ONLY checked Source, then Apply changes.
5. Click on "Download only metadata".
6. When the download is complete, click "Yes".
7. Click "OK" again to save changes and close the Edit Metadata window.
8. Click on the "Run F_rating" icon (looks like an orange starburst).
9. Click on "Set decimal retings." After this processes, you'll see a dialogue box either confirming whether it worked ("Finished extracting rating from publisherfield - for a total of X books") or not ("Finished extracting rating from publisherfield - for a total of 0 books"). Click OK to close the dialogue. Now, in the main calibre window, in each book's row and under the gr_ratings column, you should see a number ranging from 0.0 to 5.0.

!NOTE: When downloading metadata from your usual sources (to get book covers, tags, etc), you'll need to go back to the "Configure Download" window and select your preferred sources. When downloading Goodreads Decimal Ratings, you'll need to repeat the steps to download ONLY from Goodreads_Rating.

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

Version History:
Spoiler:

2020-02-17
v.3.2.0
fix for those stupid diacritics
2019-12-14
v. 3.1.0 initial version

Attached Files
File Type: zip f_rating3-2-0.zip (16.8 KB, 7198 views)

Last edited by Pr.BarnArt; 02-17-2020 at 02:00 PM. Reason: v 3.2.0
Pr.BarnArt is offline   Reply With Quote
Old 02-16-2020, 08:34 AM   #2
tytan15
Junior Member
tytan15 began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Aug 2019
Device: Kindle Voyage
Hello.
I have a problem with using of F_rating.
After runing conversion form publisher to gr_rating i have sometimes that error:
Spoiler:
calibre, version 4.10.1
BŁĄD: Nieznany wyjątek: <b>ValueError</b>:could not convert string to float: g#4.04

calibre 4.10.1 embedded-python: True is64bit: False
Windows-10-10.0.18362-SP0 Windows ('32bit', 'WindowsPE')
32bit process running on 64bit windows
('Windows', '10', '10.0.18362')
Python 2.7.16+
Windows: ('10', '10.0.18362', 'SP0', u'Multiprocessor Free')
Interface language: pl
Successfully initialized third party plugins: Gather KFX-ZIP (from KFX Input) (1, 29, 0) && Package KFX (from KFX Input) (1, 29, 0) && Goodreads_Rating (3, 0, 0) && KFX metadata reader (from KFX Input) (1, 29, 0) && KFX Input (1, 29, 0) && Reading List (1, 6, 7) && Find Duplicates (1, 6, 3) && Goodreads (1, 4, 0) && Goodreads Sync (1, 14, 2) && LubimyCzytac (2, 0, 38) && APNX Generator (1, 1, 0) && Quality Check (1, 9, 11) && Annotations (1, 12, 0) && F_rating (3, 0, 1) && Count Pages (1, 9, 0)
Traceback (most recent call last):
File "calibre_plugins.F_rating.ui", line 42, in start_change
File "calibre_plugins.F_rating.ui", line 103, in change
File "site-packages\calibre\db\legacy.py", line 472, in set_metadata
File "site-packages\calibre\db\cache.py", line 62, in call_func_with_lock
File "site-packages\calibre\db\cache.py", line 1371, in set_metadata
File "site-packages\calibre\db\cache.py", line 1314, in protected_set_field
File "site-packages\calibre\db\cache.py", line 1294, in set_field
File "site-packages\calibre\db\cache.py", line 1115, in set_field
File "site-packages\calibre\db\write.py", line 540, in set_books
File "site-packages\calibre\db\write.py", line 540, in <dictcomp>
File "site-packages\calibre\db\write.py", line 94, in adapt_number
ValueError: could not convert string to float: g#4.04


Also when Publisher has lucal language caracter "ł" or "ó" i have that error:
Spoiler:
calibre, version 4.10.1
BŁĄD: Nieznany wyjątek: <b>UnicodeDecodeError</b>:'utf8' codec can't decode byte 0xc3 in position 11: unexpected end of data

calibre 4.10.1 embedded-python: True is64bit: False
Windows-10-10.0.18362-SP0 Windows ('32bit', 'WindowsPE')
32bit process running on 64bit windows
('Windows', '10', '10.0.18362')
Python 2.7.16+
Windows: ('10', '10.0.18362', 'SP0', u'Multiprocessor Free')
Interface language: pl
Successfully initialized third party plugins: Gather KFX-ZIP (from KFX Input) (1, 29, 0) && Package KFX (from KFX Input) (1, 29, 0) && Goodreads_Rating (3, 0, 0) && KFX metadata reader (from KFX Input) (1, 29, 0) && KFX Input (1, 29, 0) && Reading List (1, 6, 7) && Find Duplicates (1, 6, 3) && Goodreads (1, 4, 0) && Goodreads Sync (1, 14, 2) && LubimyCzytac (2, 0, 38) && APNX Generator (1, 1, 0) && Quality Check (1, 9, 11) && Annotations (1, 12, 0) && F_rating (3, 0, 1) && Count Pages (1, 9, 0)
Traceback (most recent call last):
File "calibre_plugins.F_rating.ui", line 42, in start_change
File "calibre_plugins.F_rating.ui", line 102, in change
File "site-packages\calibre\ebooks\metadata\book\base.py", line 801, in __str__
File "site-packages\calibre\ebooks\metadata\book\base.py", line 733, in __unicode__representation__
File "site-packages\calibre\ebooks\metadata\book\base.py", line 723, in fmt
UnicodeDecodeError: 'utf8' codec can't decode byte 0xc3 in position 11: unexpected end of data

When i transfer data manualy it move to next books, when error appear again.
Regards
tytan15 is offline   Reply With Quote
Old 02-16-2020, 10:12 AM   #3
Pr.BarnArt
Addict
Pr.BarnArt ought to be getting tired of karma fortunes by now.Pr.BarnArt ought to be getting tired of karma fortunes by now.Pr.BarnArt ought to be getting tired of karma fortunes by now.Pr.BarnArt ought to be getting tired of karma fortunes by now.Pr.BarnArt ought to be getting tired of karma fortunes by now.Pr.BarnArt ought to be getting tired of karma fortunes by now.Pr.BarnArt ought to be getting tired of karma fortunes by now.Pr.BarnArt ought to be getting tired of karma fortunes by now.Pr.BarnArt ought to be getting tired of karma fortunes by now.Pr.BarnArt ought to be getting tired of karma fortunes by now.Pr.BarnArt ought to be getting tired of karma fortunes by now.
 
Pr.BarnArt's Avatar
 
Posts: 334
Karma: 400746
Join Date: Jun 2011
Device: Pocketbook 902 / Ipad air/ kindle paperwhite
It helps when you give an example of bookname and author.
Pr.BarnArt is offline   Reply With Quote
Old 02-16-2020, 12:01 PM   #4
tytan15
Junior Member
tytan15 began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Aug 2019
Device: Kindle Voyage
For example:
Goodread book with polish metadata (publisher: Bezdroża)
https://www.goodreads.com/book/show/13298052

or (publisher Ætherworld)
https://www.goodreads.com/book/show/37877462

Both books cause the same error "could not convert string to float".

When importing metadata with Goodreads_rating
i selected to import only publisher and only Goodreads_rating enabled.
tytan15 is offline   Reply With Quote
Old 02-16-2020, 10:12 PM   #5
dunhill
Groupie
dunhill doesn't litterdunhill doesn't litterdunhill doesn't litter
 
dunhill's Avatar
 
Posts: 168
Karma: 242
Join Date: Sep 2017
Device: moon+ reader, kindle paperwhite
Good initiative to create the plugin, but it didn't work.
I created the custom column, configured the Goodreads_rating plugin and the numbers do not appear
Attached Thumbnails
Click image for larger version

Name:	1.png
Views:	69
Size:	56.0 KB
ID:	177197   Click image for larger version

Name:	2.png
Views:	70
Size:	112.9 KB
ID:	177198   Click image for larger version

Name:	3.png
Views:	64
Size:	60.8 KB
ID:	177199  

Last edited by dunhill; 02-16-2020 at 10:16 PM.
dunhill is offline   Reply With Quote
Old 02-17-2020, 02:03 PM   #6
Pr.BarnArt
Addict
Pr.BarnArt ought to be getting tired of karma fortunes by now.Pr.BarnArt ought to be getting tired of karma fortunes by now.Pr.BarnArt ought to be getting tired of karma fortunes by now.Pr.BarnArt ought to be getting tired of karma fortunes by now.Pr.BarnArt ought to be getting tired of karma fortunes by now.Pr.BarnArt ought to be getting tired of karma fortunes by now.Pr.BarnArt ought to be getting tired of karma fortunes by now.Pr.BarnArt ought to be getting tired of karma fortunes by now.Pr.BarnArt ought to be getting tired of karma fortunes by now.Pr.BarnArt ought to be getting tired of karma fortunes by now.Pr.BarnArt ought to be getting tired of karma fortunes by now.
 
Pr.BarnArt's Avatar
 
Posts: 334
Karma: 400746
Join Date: Jun 2011
Device: Pocketbook 902 / Ipad air/ kindle paperwhite
Quote:
Originally Posted by tytan15 View Post
For example:
Goodread book with polish metadata (publisher: Bezdroża)
https://www.goodreads.com/book/show/13298052

or (publisher Ætherworld)
https://www.goodreads.com/book/show/37877462
Thank you for that.
I have made an update v 3.2.0 .
I hate those diacritics, but we have to deal with them.
I tested both in calibre python 2.7 and calibre 3.x.
I think I solved the problems, if not let me know.
Enjoy.
Pr.BarnArt is offline   Reply With Quote
Old 02-17-2020, 02:06 PM   #7
Pr.BarnArt
Addict
Pr.BarnArt ought to be getting tired of karma fortunes by now.Pr.BarnArt ought to be getting tired of karma fortunes by now.Pr.BarnArt ought to be getting tired of karma fortunes by now.Pr.BarnArt ought to be getting tired of karma fortunes by now.Pr.BarnArt ought to be getting tired of karma fortunes by now.Pr.BarnArt ought to be getting tired of karma fortunes by now.Pr.BarnArt ought to be getting tired of karma fortunes by now.Pr.BarnArt ought to be getting tired of karma fortunes by now.Pr.BarnArt ought to be getting tired of karma fortunes by now.Pr.BarnArt ought to be getting tired of karma fortunes by now.Pr.BarnArt ought to be getting tired of karma fortunes by now.
 
Pr.BarnArt's Avatar
 
Posts: 334
Karma: 400746
Join Date: Jun 2011
Device: Pocketbook 902 / Ipad air/ kindle paperwhite
Quote:
Originally Posted by dunhill View Post
Good initiative to create the plugin, but it didn't work.
I created the custom column, configured the Goodreads_rating plugin and the numbers do not appear
It works for me, but to answer your question, which book and author did you use?
What is in the publisherfield after you used goodreads-rating?
According to your screenshot you exchanged gr1 and gr_ratings for the column.
gr1 must be in the upper field, en gr_ratings in the second field.
Presuming the order of the field is the same, dispite of the language ( if that is good english;-)

Last edited by Pr.BarnArt; 02-17-2020 at 02:11 PM.
Pr.BarnArt is offline   Reply With Quote
Old 02-17-2020, 05:36 PM   #8
tytan15
Junior Member
tytan15 began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Aug 2019
Device: Kindle Voyage
Quote:
Originally Posted by Pr.BarnArt View Post
I think I solved the problems, if not let me know.
Enjoy.
You are great.
Everything works flawlessly.
Thanks for fast work.
tytan15 is offline   Reply With Quote
Old 02-17-2020, 08:30 PM   #9
dunhill
Groupie
dunhill doesn't litterdunhill doesn't litterdunhill doesn't litter
 
dunhill's Avatar
 
Posts: 168
Karma: 242
Join Date: Sep 2017
Device: moon+ reader, kindle paperwhite
Quote:
Originally Posted by Pr.BarnArt View Post
It works for me, but to answer your question, which book and author did you use?
What is in the publisherfield after you used goodreads-rating?
According to your screenshot you exchanged gr1 and gr_ratings for the column.
gr1 must be in the upper field, en gr_ratings in the second field.
Presuming the order of the field is the same, dispite of the language ( if that is good english;-)
I have changed the custom column according to your comment.
But it still doesn't work for me.
The book in question is as follows:
https://www.goodreads.com/book/show/18478401
Attached Thumbnails
Click image for larger version

Name:	1.png
Views:	65
Size:	55.8 KB
ID:	177230   Click image for larger version

Name:	2.png
Views:	60
Size:	396.0 KB
ID:	177231   Click image for larger version

Name:	3.png
Views:	55
Size:	117.2 KB
ID:	177232  
dunhill is offline   Reply With Quote
Old 02-18-2020, 02:40 PM   #10
Pr.BarnArt
Addict
Pr.BarnArt ought to be getting tired of karma fortunes by now.Pr.BarnArt ought to be getting tired of karma fortunes by now.Pr.BarnArt ought to be getting tired of karma fortunes by now.Pr.BarnArt ought to be getting tired of karma fortunes by now.Pr.BarnArt ought to be getting tired of karma fortunes by now.Pr.BarnArt ought to be getting tired of karma fortunes by now.Pr.BarnArt ought to be getting tired of karma fortunes by now.Pr.BarnArt ought to be getting tired of karma fortunes by now.Pr.BarnArt ought to be getting tired of karma fortunes by now.Pr.BarnArt ought to be getting tired of karma fortunes by now.Pr.BarnArt ought to be getting tired of karma fortunes by now.
 
Pr.BarnArt's Avatar
 
Posts: 334
Karma: 400746
Join Date: Jun 2011
Device: Pocketbook 902 / Ipad air/ kindle paperwhite
@Dunhill,

In the publisher field (editorial) the rating is missing.
I got as result: La Esfera de los Libros#PrB.rating#3.73

Do you use goodreads_rating with the right version: 3.0.0 ? See the link in the first post of this topic.
And did you disable other metadata-plugings ( p.e. goodreads ;-), just to prevent their results will be used.

Last edited by Pr.BarnArt; 02-18-2020 at 04:23 PM.
Pr.BarnArt is offline   Reply With Quote
Old 02-19-2020, 09:31 PM   #11
dunhill
Groupie
dunhill doesn't litterdunhill doesn't litterdunhill doesn't litter
 
dunhill's Avatar
 
Posts: 168
Karma: 242
Join Date: Sep 2017
Device: moon+ reader, kindle paperwhite
Quote:
Originally Posted by Pr.BarnArt View Post
@Dunhill,

In the publisher field (editorial) the rating is missing.
I got as result: La Esfera de los Libros#PrB.rating#3.73

Do you use goodreads_rating with the right version: 3.0.0 ? See the link in the first post of this topic.
And did you disable other metadata-plugings ( p.e. goodreads ;-), just to prevent their results will be used.
Now if Pr.BarnArt everything works! Excellent work.
I thought that the goodreads_rating plugin and the goodreads plugin worked together
Attached Thumbnails
Click image for larger version

Name:	1.png
Views:	57
Size:	49.6 KB
ID:	177259  
dunhill 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] KindleUnpack - The Plugin DiapDealer Plugins 434 07-07-2020 06:44 AM
[GUI Plugin] Save Virtual Libraries To Column (GUI) chaley Plugins 9 04-11-2020 07:14 AM
[GUI Plugin] Manga plugin mastertea Plugins 0 10-20-2019 02:45 PM
The operator >> is undefined for the argument type(s) float, float twobob Kindle Developer's Corner 10 09-05-2012 12:50 PM
[GUI Plugin] Plugin Updater **Deprecated** kiwidude Plugins 159 06-19-2011 12:27 PM


All times are GMT -4. The time now is 04:40 PM.


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