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:
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.
Take a look at https://pypi.python.org/pypi/isbntools, it will allow you to 'hyphenate' ISBNs and much more, like extracting, cleanning, transforming, and get metadata.
This is a library (that you can use in your program) but it installs several 'scripts' that you can use from the command line.
I wrote the following JavaScript function to hyphenate ISBNs (I know there is also isbnjs, but this is more compact and easier to include in other projects I think).
https://gist.github.com/aurimasv/6693537
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: Gérminal)
You can check your algorithm at the Library of Congress's ISBN hyphenation tool.