I've got ISBN numbers (10-digits and 13 digits) without the dashes. Now I'm looking for a way to add those dashes automatically.
I found some useful information here: http://www.isbn.org/standards/home/isbn/international/hyphenation-instructions.asp
But I'm not sure if it's doable at all, because the publisher identifier has a random length, and without knowing it, it's maybe not possible to determine the correct positions for the dashes.
Does anybody know if it's possible somehow?
Thanks a lot!
In addition to identifying (a particular edition of) a book, ISBNs allow one to search for the book, both at libraries and bookstores. You can enter an ISBN number on this Wikipedia ISBN search page. Spaces and hyphens in the ISBN do not matter.
The International Standard Book Number (ISBN) is a 13-digit number that uniquely identifies books and book-like products published internationally. The ISBN is intended for a monographic publication: text that stands on its own as a product, whether printed, audio or electronic.
You can deduce the length of the publisher identifier if you have the full range tables.
Example 1. ISBN 0141439564 (Penguin: Great Expectations)
Example 2. ISBN 2253004227 (Poche: Germinal)
You can check your algorithm at the Library of Congress's ISBN hyphenation tool.
For Python, you can use the library python-stdnum, isbnid or isbn_hyphenate. They can hyphenate ISBNs, and use the range table mentioned in the other answer.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With