This object stores the information about an author.
The Author may have a nom de plume.
Attributes
name: str
-
pen_name: str
-
Author’s Nom de plume
Examples
from goodreads_normalizer import Author
author = Author(name="Brandon Sanderson")
print(f"Author: {author.display_name}")
print(f"Slug: {author.slug}")
author = Author(name="Shirtaloon")
print(f"Display Name: {author.display_name}")
print(f"Is Pen Name: {author.is_pen_name}")
print(f"Slug: {author.slug}")
print(f"Pen Name: {author.pen_name}")
print(f"Name: {author.name}")
Author: Brandon Sanderson
Slug: sanderson-brandon
Display Name: Shirtaloon
Is Pen Name: True
Slug: shirtaloon
Pen Name: Shirtaloon
Name: Travis Deverell
If the Author name is in the NARRATORS list and is also not in the AUTHORS list, a ValueError will be raised, which is then transformed into a ValidationError by pydantic.