faker.providers.isbn

class faker.providers.isbn.Provider(generator)

Bases: faker.providers.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='-')
Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.isbn10()
...
'1-60487-647-6'
'1-382-42194-X'
'1-924115-78-6'
'0-938778-40-4'
'1-01-609753-0'
isbn13(separator='-')
Examples:
>>> Faker.seed(0)
>>> for _ in range(5):
...     fake.isbn13()
...
'978-1-60487-647-5'
'978-1-382-42194-2'
'978-1-924115-78-0'
'978-0-938778-40-0'
'978-1-01-609753-6'