steenzout.barcode.isxn module

ISXN module.

Provided barcodes:
 ISBN-13, ISBN-10, ISSN

This module provides some special codes, which are no standalone bar codes.

All codes where transformed to EAN-13 barcodes.

In every case, the checksum is new calculated.

Example:

>>> from steenzout.barcode import get_barcode
>>> ISBN = get_barcode('isbn10')
>>> isbn = ISBN('0132354187')
>>> unicode(isbn)
u'0132354187'
>>> isbn.get_fullcode()
u'9780132354189'
>>> # Test with wrong checksum
>>> isbn = ISBN('0132354180')
>>> unicode(isbn)
u'0132354187'
class ISBN10(code, writer=None)[source]

Bases: steenzout.barcode.isxn.ISBN13

Class for ISBN-10 bar codes.

Parameters:
  • code (str) – ISBN number.
  • writer (writer.BaseWriter) – instance of writer class to render the bar code.
static calculate_checksum(code)[source]
digits = 10
ean13()[source]

Returns the EAN-13 representation of the ISBN-10 bar code.

Returns:EAN-13 representation of the bar code.
Return type:(EAN13)
isbn13()[source]

Returns the ISBN-13 representation of the ISBN-10 bar code.

Returns:ISBN-13 representation of the bar code.
Return type:(ISBN13)
name = 'ISBN-10'
static validate(code)[source]
class ISBN13(isbn, writer=None)[source]

Bases: steenzout.barcode.ean.EAN13

Class for ISBN-13 bar codes.

Parameters:
  • isbn (str) – ISBN number.
  • writer (writer.BaseWriter) – instance of writer class to render the bar code.
static calculate_checksum(code)[source]
digits = 13
name = 'ISBN-13'
static validate(code)[source]
class ISSN(issn, writer=None)[source]

Bases: steenzout.barcode.ean.EAN13

Class for ISSN bar codes.

This code is rendered as EAN-13 by prefixing it with 977 and adding 00 between code and checksum.

Parameters:
  • issn (str) – issn number.
  • writer (writer.BaseWriter) – instance of writer class to render the bar code.
build()[source]

Builds the barcode pattern from self.ean.

Returns:The pattern as string.
Return type:(str)
static calculate_checksum(code)[source]
digits = 8
ean13()[source]

Returns the EAN-13 representation of the ISSN bar code.

Returns:EAN-13 representation of the bar code.
Return type:(EAN13)
name = 'ISSN'
static validate(code)[source]
InternationalStandardBookNumber10

alias of ISBN10

InternationalStandardBookNumber13

alias of ISBN13

InternationalStandardSerialNumber

alias of ISSN