faker.providers.sbn.sbn
¶
This module is responsible for generating the check digit and formatting SBN numbers.
Module Contents¶
Classes¶
- class faker.providers.sbn.sbn.SBN(registrant: Optional[str] = None, publication: Optional[str] = None)¶
- MAX_LENGTH = 9¶
- class faker.providers.sbn.sbn.SBN9(*args: Any, **kwargs: Any)¶
Bases:
SBN
- _check_digit() str ¶
Calculate the check digit for SBN-9. SBNs use the same check digit calculation as ISBN. See https://en.wikipedia.org/wiki/International_Standard_Book_Number
for calculation. Only modification is weights range from 1 to 9 instead of 1 to 10.