Skip to main content

This module supports the calculation of ISBN checksums with calculate_checksum(), the conversion between ISBN-10 and ISBN-13 with convert() and the validation of ISBNs with validate().

All the ISBNs must be passed in as str types, even if it would seem reasonable to accept some int forms. The reason behind this is English speaking countries use 0 for their group identifier, and Python would treat ISBNs beginning with 0 as octal representations producing incorrect results. While it may be feasible to allow some cases as non-str types the complexity in design and usage isn’t worth the minimal benefit.

The functions in this module also support 9-digit SBNs for people with older books in their collection.

Metadata

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