Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Plugins

Notices

Reply
 
Thread Tools Search this Thread
Old 05-29-2023, 09:49 AM   #1
PvanG
Junior Member
PvanG began at the beginning.
 
Posts: 3
Karma: 10
Join Date: May 2023
Location: Netherlands
Device: Moon+Reader on Android
ISBN-x to ISBN-13 conversion / sort

As a collector of epubs, 21.5k books now, and fixing all entries to todays standards e.g as correct as possible meta-data.
I am looking for a plugin that converts a selected ISBN to ISBN13 or a plugin that allows to sort/select all none-ISBN13.
Is there any work in progress that would help in that or does anyone now the trick to sort?
Conversion tools are available outside Calibre as
here: https://www.boek.nl/content/nurcode
PvanG is offline   Reply With Quote
Old 05-29-2023, 11:06 AM   #2
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 11,764
Karma: 7029857
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
To search for any isbn that isn't an ISBN-13 (isn't 13 characters long), put this in the search bar. It is a regular expression search that matches any 13-long ISBN, then negates the match. See the calibre manual for search expression syntax.
Code:
not identifiers:isbn:~^.{13}$
This python template converts ISBN-10 values to ISBN-13, or at least it does for the few tests I ran. You can use it in the Action Chains plugin using a Single Field Edit to convert the value for specific books. Ask in that thread if you need help.
Code:
python:
def evaluate(book, context):
	isbn = book.get('identifiers').get('isbn', '')
	isbn = isbn.strip('-')
	if len(isbn) == 10: # poor man's isbn-10 validation.
		isbn = '978' + isbn[:-1]
		chk = sum(int(c) for c in isbn[0::2]) + sum(int(c)*3 for c in isbn[1::2])
		isbn += str((10 - (chk % 10)) % 10)
	return isbn
chaley is offline   Reply With Quote
Advert
Old 05-29-2023, 11:12 AM   #3
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,892
Karma: 55267620
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Not exact what you asked for. Maybe you can run with this in the mean time.

This search finds ISBN13

Code:
identifiers:"=isbn:97"
this finds ISBN13 because ISBN13 start with 97

While some books had ISBN10 and ISBN13, not all did and many ISBN10 are different editions, so what does conversion to a nonresistant number get you?


I will bite: Why sort? AFAIK nobody 'shelves' books by ISBN, so the sort has no obvious use.
ISBN was created to aid a bookseller in ordering. They are basically just a serialized order number by Publisher. language-publisher-sequence-check digit (mod10)
theducks is offline   Reply With Quote
Old 05-29-2023, 11:24 AM   #4
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 11,764
Karma: 7029857
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by theducks View Post
This search finds ISBN13

Code:
identifiers:"=isbn:97"
this finds ISBN13 because ISBN13 start with 97
That search finds any isbn containing 97, not starting with 97.

This search fixes it:
Code:
identifiers:isbn:~^97
chaley is offline   Reply With Quote
Old 05-29-2023, 12:13 PM   #5
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,892
Karma: 55267620
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by chaley View Post
That search finds any isbn containing 97, not starting with 97.

This search fixes it:
Code:
identifiers:isbn:~^97
oops
I pasted the wrong search
theducks is offline   Reply With Quote
Advert
Old 05-29-2023, 01:11 PM   #6
PvanG
Junior Member
PvanG began at the beginning.
 
Posts: 3
Karma: 10
Join Date: May 2023
Location: Netherlands
Device: Moon+Reader on Android
Great! Part-1 did a lot for me already!! Returned 2680 out of 21.5K entries with a no-13 ISBN.

Reading the manual (RTFM) would do the job probably but would take me much more time!

Takes me to step 2 ;-)
PvanG is offline   Reply With Quote
Old 05-29-2023, 03:34 PM   #7
ownedbycats
Custom User Title
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 8,738
Karma: 62032183
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Quote:
Originally Posted by chaley View Post
To search for any isbn that isn't an ISBN-13 (isn't 13 characters long), put this in the search bar. It is a regular expression search that matches any 13-long ISBN, then negates the match. See the calibre manual for search expression syntax.
Code:
not identifiers:isbn:~^.{13}$
I had to use
Code:
identifiers:"=isbn:" AND not identifiers:isbn:~^.{13}$
otherwise I got a bunch of books with no ISBN at all
ownedbycats is offline   Reply With Quote
Old 05-29-2023, 03:54 PM   #8
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 11,764
Karma: 7029857
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by ownedbycats View Post
I had to use
Code:
identifiers:"=isbn:" AND not identifiers:isbn:~^.{13}$
otherwise I got a bunch of books with no ISBN at all
The OP asked for a search that returned anything that wasn't an ISBN-13, which includes empty ISBNs.
chaley is offline   Reply With Quote
Old 05-29-2023, 10:56 PM   #9
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 36,060
Karma: 145735366
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Forma, Clara HD, Lenovo M8 FHD, Paperwhite 4, Tolino epos
For what little it is worth, I simply searched for any ISBN not starting with 978 (group: books). I didn't have any books in my library with the 4-6 digits being 978 though I did find 11 that did not have any ISBN in the metadata.
DNSB is offline   Reply With Quote
Old 05-30-2023, 12:15 AM   #10
ownedbycats
Custom User Title
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 8,738
Karma: 62032183
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
979 ISBNs are becoming more common -- I have them on a few of my books, the earlest one from 2020.
ownedbycats is offline   Reply With Quote
Old 05-30-2023, 09:48 AM   #11
PvanG
Junior Member
PvanG began at the beginning.
 
Posts: 3
Karma: 10
Join Date: May 2023
Location: Netherlands
Device: Moon+Reader on Android
To all,
thanks for your input!
The: not identifiers:isbn:~^.{13}$
did the job for me, @chaley thanks for that!
PvanG is offline   Reply With Quote
Reply

Tags
calibre, isbn-13, linuxmint, plugin development


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
"Add from ISBN" adds empty entry for valid ISBN halloleo Library Management 7 07-16-2021 10:47 PM
How to move ISBN in book name to Ids/#ISBN? simoon Library Management 0 10-10-2019 12:13 AM
ASIAN, ISBN and ISBN-13 jbcohen General Discussions 2 04-02-2013 02:27 PM
ISBN Changes on Conversion from epub to mobi amuise Conversion 3 09-13-2011 10:46 PM
Stupid Question: ISBN-10 and ISBN-13 Tegan Library Management 4 03-11-2011 01:20 AM


All times are GMT -4. The time now is 09:55 AM.


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