ISBN validation module

This module is providing funcionality to validate and compute ISBN checksums.

See is_valid_isbn() for details.

API

isbn_validator.isbn_validator.get_isbn10_checksum(isbn)[source]
Parameters:isbn (str/list) – ISBN number as string or list of digits

Warning

Function expects that isbn is only 9 digits long.

Returns:Last (checksum) digit for given isbn.
Return type:int
isbn_validator.isbn_validator.is_isbn10_valid(isbn)[source]

Check if given isbn 10 is valid.

Parameters:isbn (str/list) – ISBN number as string or list of digits.
Returns:True if ISBN is valid.
Return type:bool
isbn_validator.isbn_validator.get_isbn13_checksum(isbn)[source]
Parameters:isbn (str/list) – ISBN number as string or list of digits.

Warning

Function expects that isbn is only 12 digits long.

Returns:Last checksum digit for given isbn.
Return type:int
isbn_validator.isbn_validator.is_isbn13_valid(isbn)[source]

Check if given isbn 13 is valid.

Parameters:isbn (str/list) – ISBN number as string or list of digits.
Returns:True if ISBN is valid.
Return type:bool
isbn_validator.isbn_validator.is_valid_isbn(isbn)[source]

Validate given isbn. Wrapper for is_isbn10_valid()/ is_isbn13_valid().

Parameters:isbn (str/list) – ISBN number as string or list of digits.

Note

Function doesn’t require isbn type to be specified (it can be both 10/13 isbn’s versions).

Returns:True if ISBN is valid.
Return type:bool