05-29-2023, 09:49 AM | #1 |
Junior Member
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 |
05-29-2023, 11:06 AM | #2 |
Grand Sorcerer
Posts: 11,916
Karma: 7176769
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}$ 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 |
05-29-2023, 11:12 AM | #3 |
Well trained by Cats
Posts: 30,326
Karma: 58000000
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" 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) |
05-29-2023, 11:24 AM | #4 |
Grand Sorcerer
Posts: 11,916
Karma: 7176769
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
|
05-29-2023, 12:13 PM | #5 |
Well trained by Cats
Posts: 30,326
Karma: 58000000
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
|
05-29-2023, 01:11 PM | #6 |
Junior Member
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 ;-) |
05-29-2023, 03:34 PM | #7 | |
Custom User Title
Posts: 9,241
Karma: 63194753
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
Quote:
Code:
identifiers:"=isbn:" AND not identifiers:isbn:~^.{13}$ |
|
05-29-2023, 03:54 PM | #8 |
Grand Sorcerer
Posts: 11,916
Karma: 7176769
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
|
05-29-2023, 10:56 PM | #9 |
Bibliophagist
Posts: 39,157
Karma: 153098470
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, 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.
|
05-30-2023, 12:15 AM | #10 |
Custom User Title
Posts: 9,241
Karma: 63194753
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.
|
05-30-2023, 09:48 AM | #11 |
Junior Member
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! |
Tags |
calibre, isbn-13, linuxmint, plugin development |
|
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 |