View Single Post
Old 02-26-2011, 03:01 PM   #1
calibre/Sigil Developer
kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.
Posts: 4,252
Karma: 1578442
Join Date: Oct 2010
Location: London, UK
Device: Kindle Paperwhite, iPad Pro
[GUI Plugin] Goodreads Sync

This plugin allows you to synchronise your book collection in Calibre with your shelves on a account.

Goodreads targets the social aspects of sharing your book lists with friends and family. It offers various services such as reviews, book clubs, discussions and recommendations. You can maintain shelves of books you have read, want to read, are currently reading or others of your own design.

In some cases this is information that you also want to keep track of within Calibre using tags or custom columns. Typical examples of usage of this plugin are:
  • Adding a book that you have just imported to Calibre to your 'to-read' shelf on Goodreads
  • Updating a Calibre custom column to indicate that you have read a book when syncing from your 'read' shelf on Goodreads
  • Multiple actions can be applied. e.g. in the example above you might also populate a 'Read Date' custom column and remove a 'To Read' tag from the book in Calibre.
  • Using your own genre shelves in Goodreads like science-fiction, romance etc to map to Calibre tags or a custom genre column of your choice.

Main Features:
  • Add or remove books to one or more Goodreads shelves from a selection within Calibre
  • Syncing the contents from one or more Goodreads shelves into Calibre, performing customisable actions for each shelf
  • Configure actions to be performed for when adding books to a shelf or syncing from Goodreads, such as updating tags, custom columns.
  • You can also synchronise your rating, date read and or review text custom column with your Goodreads review.
  • Ability to download tags for your books based on the shelves they are on. You can customise which Calibre tags if any each shelf name will map to and use a custom genre column instead of tags if desired.
  • Ability to upload to shelves for your books based on the tags they have been given. Applies the to the same Calibre column and shelf mappings as for the download tags feature above.
  • Link your Calibre books to a Goodreads equivalent giving you right-click access to reviews or other information for that book
  • Ability to switch editions for a linked Goodreads book
  • Ability to create Empty Books in Calibre for books you sync from a Goodreads shelf
  • Optionally update the ISBN in Calibre to match the edition on your Goodreads shelf
  • Supports multiple Goodreads user accounts if required for users sharing a single operating system account
  • Help file web page available from the configuration dialog or plugin menu

Special Notes:
  • Requires Calibre v0.8.18 or later.
  • Please don't abuse this plugin by using it to put many hundreds or thousands of books on your shelves. Goodreads T&C require a very limited threshold on the number of API calls per minute. Worst case they will block the plugin and that ruins it for everyone. You can use CSV export/import to Goodreads for large volumes if you need it. Refer to the help page within the plugin for the full details.

Installation Steps:
  1. Download the attached zip file and install the plugin/restart Calibre/add to context menu or toolbar as described in the Introduction to plugins thread.
  2. Click on "Customize plugin" in the context menu to authorize the plugin with your Goodreads account. This option is also available via the Preferences->Plugins dialog once you select it within the list.
  3. You should now be able to add books from Calibre to your shelves.
  4. To sync from a shelf into Calibre, setup at least one action for the appropriate shelf from the configuration dialog.
  5. To tag your books based on their Goodreads shelves, edit the mappings between shelf and tag names from the configuration dialog.
  6. Refer to the Help file (available from plugin menu and configuration dialog) for more information and known issues.

Displaying a Goodreads Identifier Column:
  • As of v1.1 of this plugin you can display the Goodreads Id as a column in Calibre, to quickly see which books you have linked:
    Add a custom column with Preferences->Add your own columns. I suggest the following values if you want to display the numeric id:
    Lookup name: goodreads
    Column heading: Goodreads
    Column type: Column built from other columns
    Template: {identifiers:select(goodreads)}

    If instead you want to display a yes/no type column then do the above with the following differences:
    Template: program: test(select(field('identifiers'),'goodreads'),'Yes ','No')
    Show checkmarks: Ticked

    If you do not want a cross to appear next to unlinked books, change the 'No' to '' in the above template

Paypal Donations:
  • If you find this or any of my other plugins useful please feel free to show your appreciation. I have spent many hundreds of unpaid hours in their development and support so any encouragement for me to continue is appreciated!

Version History:

Version 1.14.2 - 12 February 2020 - made by davidfor
Fix: Decode result from parse_qsl for Python 3.

Version 1.14.1 - 03 February 2020 - made by davidfor
Update: Missed some strings for translations.
Update: Spanish translation thanks to dunhill.

Version 1.14.0 - 28 January 2020 - made by davidfor
New: Make translatable.
New: Spanish translation thanks to dunhill.
Update: Changes for Python 3 support in calibre.

Version 1.13.0 - 02 January 2020 - made by davidfor
Fix: Set a default width for the title column in all dialogs.
New: Use dropdown for editing tag-like columns when editing shelf add and sync actions.
Fix: Tags in sync/add actions should be comma separated.
New: Added progress bars for most actions
Change: Match a change in calibre related to "RECOVER_PARSER".

Version 1.12.1 - 04 Oct 2018 - made by davidfor
Fix: Remove unneeded import of pin_columns.

Version 1.12.0 - 17 Apr 2018 - made by davidfor
Fix: Errors when the series index was not just a number.
Fix: Edit the rating in the Sync Progress dialog gives an error and the drop down appears in the wrong place.
Fix: Use local timezone when displaying the date read.

Version 1.11.0 - 20 Dec 2017
Update: Change to only use HTTPS due to site changes.
Change: Update httplib2 to latest version.

Version 1.9.0 - 14 Mar 2016
Add sorting for most of the dialogs
Add option to put finished books on the read shelf from the update progress dialog
Limit comment text to 420 characters when updating the reading progress.
Don't use the review column for the reading progress comment.

Version 1.8.0 - 11 Nov 2015
Add support for proxies.
Add detail to error message when searching for editions.

Version 1.7.7 - 11 Jan 2015
Fix drag/drop into the Goodreads dialog due to change to use of HTTPS url

Version 1.7.6 - 15 Dec 2014
Improved dynamic menu support in line with calibre changes

Version 1.7.5 - 23 Aug 2014
Fix for changes to support calibre 2.0

Version 1.7.4 - 12 Aug 2014
Support for upcoming calibre 2.0

Version 1.7.3 - 11 Nov 2013
Fix drag/drop into the Goodreads dialog due to change to use of HTTPS url

Version 1.7.2 - 24 Aug 2013
Replace some incorrect legacy code that was looking up the old ISBN field in the database instead of identifiers.
Fix for when Goodreads error is thrown during Add to Shelf to ensure a second error is not displayed to user.

Version 1.7.1 - 05 Jun 2012
Fix bug of switching editions throwing error caused by changes in 1.7.0

Version 1.7.0 - 02 Jun 2012
Allow synchronising review text to/from goodreads
Change the date handling to (hopefully) correctly handle timezones for issues some users experienced
Adjust some dialog layouts to ensure buttons are sized better with different styles applied
Minor performance enhancement for when syncing books from large shelves
Enable gzip compression for oauth calls to see if improves performance

Version 1.6.7 - 12 May 2012
Fix for book titles containing apostrophes for when searching to link books

Version 1.6.6 - 03 May 2012
Fix bug when error dialog is to be displayed about missing a custom column

Version 1.6.5 - 20 Apr 2012
Change the url for authentication to not have a trailing slash as recent Goodreads release broke this.
Add protection for blank author from bug in calibre
When get an error during authentication, do not throw a misleading second error.

Version 1.6.4 - 14 Feb 2012
For the switch edition feature, ensure that variations of ISBN scraped from web page are handled better
On Add to shelf dialog, make the Add to shelf button a default one so can just hit enter

Version 1.6.3 - 12 Feb 2012
Add a Switch edition dialog for a linked book to allow picking another edition for page count/cover purposes
Also allow access to the switch edition dialog from the linked book screen.

Version 1.6.2 - 30 Dec 2011
Fix for missing config value for users upgrading to 1.6 then using sync without configuring shelf first.

Version 1.6.1 - 21 Dec 2011
Fix for the Download shelves as tags feature, broken in 1.6.0

Version 1.6.0 - 20 Dec 2011
Adding to/removing from shelves changes:
- support add/remove to multiple shelves (remembers last choice)
- support uploading your calibre rating and/or date read custom column
- support performing other actions when adding to shelf such as setting custom column values
Syncing from shelves changes:
- support syncing from multiple shelves (intermediate dialog that remembers last choice)
- support syncing your Goodreads rating and/or date read to custom columns
- dialog now shows what actions will be applied/columns updated for selected shelves
Configuration dialogs reworked:
- tag mappings now edited directly in the shelves grid
- support multi-select to allow specifying sync rules for multiple shelves at once
- support configuring actions to take place when adding books to a shelf
- support uploading rating & date read to goodreads on a per shelf basis
- support syncing rating & date read from goodreads on a per shelf basis
- support specifying which columns to sync to for tags, date read and ratings
- support options for hiding Add to shelf and Sync from shelf menus
- drop the restriction allowing only one action for a specific column (to allow people to do add/remove tags in a single sync action)
Menus reworked:
- add/remove shelf no longer has a shelves submenu forcing a single shelf. Can choose multiple shelves on the new dialog.
- sync from shelf no longer has a shelves submenu forcing a single shelf. Intermediate dialog to choose instead.
Change the configuration file to store the tag mappings in the shelves data, and tag mapping column no longer per user
When matching against a calibre book from the sync dialog, exclude trailing punctuation from title/author
Add tooltips to the add shelf dialog
When a Goodreads error occurs, include the xml error response in the error dialog as has reason for error
Upgrade oauth2 to v1.5.210 and httplib2 to v0.7.2
Remove support for users upgrading from versions prior to 1.1

Version 1.5.1 - 19 Sep 2011
Fix bug in new menu building code for when a user has multiple Goodreads user accounts setup.

Version 1.5.0 - 17 Sep 2011
Upgrade to support the centralised keyboard shortcut management in Calibre

Version 1.4.15 - 11 Jul 2011
Fix bug of DEBUG not available when error thrown
Ensure the book details pane is updated after adding a Goodreads link to the selected book

Version 1.4.14 - 17 Jun 2011
Allow enumerated text columns for sync action columns
Ensure the book details pane is updated after removing a Goodreads link to the selected book

Version 1.4.13 - 02 Jun 2011
Upgrade the oauth2 library to 1.5.170
Ensure the book details pane is updated after shelf changes or linking books

Version 1.4.12 - 17 May 2011
Fix bug of removing from id cache error when does not exist in cache

Version 1.4.11 - 09 May 2011
Do not try to write null ISBN to database after performing a sync

Version 1.4.10 - 08 May 2011
Change all webbrowser launching to use Calibre's wrapper for the default browser for better Linux support

Version 1.4.9 - 07 May 2011
Bugfix for no ISBN causing errors when adding to shelf

Version 1.4.8 - 04 May 2011
Bugfix for correct error dialog not showing when have an error during Goodreads communication.
Remove the add shelves button from the edit shelf tag mappings dialog. Always display all your shelves.
When adding a shelf to the mapping list, default it to having no Calibre tags instead of a tag of the shelf name.

Version 1.4.7 - 23 Apr 2011
Force the Goodreads/Calibre id caches to be updated more frequently.

Version 1.4.6 - 13 Apr 2011
Change the URL searched against as Goodreads have changed their website.

Version 1.4.5 - 09 Apr 2011
Support skinning of icons by putting them in a plugin name subfolder of local resources/images

Version 1.4.4 - 08 Apr 2011
Change the Download shelves as tags behaviour so that if the target is a custom column it always overwrites

Version 1.4.3 - 07 Apr 2011
Add a Paste right-click option (ctrl+V) to Pick Goodreads book dialog as alternative for Opera users to drag/drop

Version 1.4.2 - 07 Apr 2011
Bugfix for URL not defined introduced in 1.4 when Search

Version 1.4.1 - 04 Apr 2011
Bugfix for moved functions not declared properly reported by kenr276
Bugfix for settings not saving when ok in preferences
Bugfix for edit shelf/tag mappings after switching libraries where col does not exist

Version 1.4 - 03 Apr 2011
Rewritten for new plugin infrastructure in Calibre 0.7.53

Version 1.3.2 - 23 Mar 2011
Allow upload tags for a book that is not on your exclusive shelves

Version 1.3.1 - 23 Mar 2011
Bug-fix for selected_goodreads_id function rename

Version 1.3 - 23 Mar 2011
Add "Upload tags to shelves" feature, as a mirror to the "Download tags from shelves"

Version 1.2 - 16 Mar 2011
Allow Download tags from shelves to be targeted at a custom column, not just tags.
Bugfix for drag/drop where url had '-' instead of '.' separator

Version 1.1.1 - 09 Mar 2011
Bugfix for download shelves as tags

Version 1.1 - 09 Mar 2011
Add menu/config options to download tags from shelves
Add option to create new shelves
Add option to edit shelves on Goodreads from config dialog
Add warning when removing from exclusive shelves
Migrate Goodreads Id to Identifiers
Remove restriction on #shelves downloaded.
Bugfix for no Goodreads book selected when linking
Bugfix for book showing as linked after deleted
Bugfix for no isbn giving NoneType error
Bugfix for trailing whitespace title

Version 1.0 - 27 Feb 2011
Initial release of Goodreads Sync plugin

Attached Thumbnails
Click image for larger version

Name:	screenshot_1_toolbar.png
Views:	6356
Size:	29.6 KB
ID:	80169   Click image for larger version

Name:	screenshot_2_customize.png
Views:	5886
Size:	65.7 KB
ID:	80170   Click image for larger version

Name:	screenshot_3_edit_shelf_add_actions.png
Views:	5701
Size:	23.2 KB
ID:	80171   Click image for larger version

Name:	screenshot_4_add_to_shelf.png
Views:	4891
Size:	36.9 KB
ID:	80172   Click image for larger version

Name:	screenshot_5_pick_calibre_book.png
Views:	4246
Size:	40.6 KB
ID:	80173   Click image for larger version

Name:	screenshot_6_sync_from_shelf.png
Views:	4454
Size:	55.2 KB
ID:	80174   Click image for larger version

Name:	screenshot_7_pick_goodreads_book.png
Views:	3848
Size:	23.1 KB
ID:	80175  
Attached Files
File Type: zip Goodreads (266.5 KB, 5435 views)

Last edited by BetterRed; 02-12-2020 at 04:36 PM. Reason: Update PI to Version 1.14.2
kiwidude is offline   Reply With Quote