faker.providers.isbn

class faker.providers.isbn.Provider(generator: Any)

Bases: BaseProvider

Generates fake ISBNs. ISBN rules vary across languages/regions so this class makes no attempt at replicating all of the rules. It only replicates the 978 EAN prefix for the English registration groups, meaning the first 4 digits of the ISBN-13 will either be 978-0 or 978-1. Since we are only replicating 978 prefixes, every ISBN-13 will have a direct mapping to an ISBN-10.

See https://www.isbn-international.org/content/what-isbn for the format of ISBNs. See https://www.isbn-international.org/range_file_generation for the list of rules pertaining to each prefix/registration group.

isbn10(separator: str = '-') str
Examples:

>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.isbn10()
...
'1-04-876475-3'
'0-421-94892-2'
'0-15-781565-X'
'1-78408-016-0'
'1-5351-3933-1'
isbn13(separator: str = '-') str
Examples:

>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.isbn13()
...
'978-1-04-876475-8'
'978-0-421-94892-1'
'978-0-15-781565-8'
'978-1-78408-016-7'
'978-1-5351-3933-5'