Monday, March 27, 2006

ISBN Tool

On oss4lib the ISBN tool ISBN.pm was noted. This is a versatile tool able to perform these tasks:
  • convert($isbn)
    Takes a 10 digit ISBN and returns the 13 digit equivalent. Does not perform any error checking or validation.
  • gettype($isbn)
    Takes a string value and will make a guess as to whether or not it fits the criteria of an ISBN. Returns 10 for a possible ISBN-10 and 13 for ISBN-13. Does not validate further.
  • validateten($isbn)
    Takes a 10 digit numeric value and checks to determine if it is a valid ISBN-10.
  • validatettn($isbn)
    Takes a 13 digit numeric value and checks to determine if it is a valid ISBN-13.
  • genchksum13($isbn)
    Takes a 12 digit numeric value and generates an ISBN-13 checksum digit.
  • genchksum10($isbn)
    Takes a 9 digit numeric value and generates an ISBN-10 checksum digit.
  • printinvalid()
    Returns a message informing the user the ISBN is invalid.
Note if the item does not include the 13 digit numbers with the prefix ISBN we are not to treat it as one. We can't take this tool and generate 13 digit ISBNs and plug them into records as such. They could go elsewhere in the record, just not 020.

No comments: