MCPcopy Create free account
hub / github.com/WhyNotHugo/python-barcode / __init__

Method __init__

barcode/isxn.py:45–52  ·  view source on GitHub ↗
(self, isbn, writer=None, no_checksum=False, guardbar=False)

Source from the content-addressed store, hash-verified

43 name = "ISBN-13"
44
45 def __init__(self, isbn, writer=None, no_checksum=False, guardbar=False) -> None:
46 isbn = isbn.replace("-", "")
47 self.isbn13 = isbn
48 if isbn[:3] not in ("978", "979"):
49 raise WrongCountryCodeError("ISBN must start with 978 or 979.")
50 if isbn[:3] == "979" and isbn[3:4] not in ("1", "8"):
51 raise BarcodeError("ISBN must start with 97910 or 97911.")
52 super().__init__(isbn, writer, no_checksum, guardbar)
53
54
55class InternationalStandardBookNumber10(InternationalStandardBookNumber13):

Callers 2

__init__Method · 0.45
__init__Method · 0.45

Calls 2

BarcodeErrorClass · 0.90

Tested by

no test coverage detected