Skip to main content
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:

Metadata

Release files for isbn_hyphenate 1.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for isbn_hyphenate 1.0.4
File Size Uploaded
isbn_hyphenate-1.0.4.tar.gz 11.4 kB Details

Release files / isbn_hyphenate-1.0.4.tar.gz

Download URL isbn_hyphenate-1.0.4.tar.gz
Size 11.4 kB
Tags Source
SHA-256 checksum
How to use checksums
59c4c359dcb46b03a62ed4cf60a0999ac2dd53d8c9b0a87223efdde432b07a86
BLAKE2b-256 checksum
How to use checksums
28e0f7bec3443f5e9cd9da6d03fb684d66a91335f1186cd7830a659f8e0903a2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

1.0.4 This release

1 release file

1.0.3

1 release file

1.0.2

1 release file

1.0.1

1 release file

1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page