Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

a Python library to add hyphens in the right place to an ISBN (International Standard Book Number)

Project Description
isbn_hyphenate is a Python library to add hyphens in the right place to an ISBN (International Standard Book Number). Example:
>>> import isbn_hyphenate
>>> isbn_hyphenate.hyphenate("9781590593561")
'978-1-59059-356-1'

Most libraries for handling ISBNs can not do hyphenation because it requires using a list of prefixes, available from the International ISBN Agency.

isbn_hyphenate can handle both 10 and 13 digit ISBNs, and will keep the number of digits. If the ISBN is malformed (wrong length or invalid characters) an IsbnMalformedError exception is raised. If the correct hyphen positions cannot be determined, an IsbnUnableToHyphenateError exception is raised. This can mean that the input ISBN is wrong, or it is in a range that is not yet in the known list.

isbn_hyphenate is compatible with both Python 2 and 3.

To update the prefix list:
  1. Download a new RangeMessage.xml file from https://www.isbn-international.org/range_file_generation
  2. Convert it to Python format: ./isbn_xml2py.py RangeMessage.xml > isbn_lengthmaps.py
These alternative Python libraries can also hyphenate:
Release History

Release History

This version
History Node

1.0.4

History Node

1.0.3

History Node

1.0.2

History Node

1.0.1

History Node

1

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
isbn_hyphenate-1.0.4.tar.gz (11.4 kB) Copy SHA256 Checksum SHA256 Source Feb 20, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting