thoth.thoth_models¶
Attributes¶
Classes¶
A title entry for a Thoth work. |
|
An abstract entry for a Thoth work. |
|
A contributor entry for a Thoth work. |
|
A subject/keyword entry for a Thoth work. |
|
A publication record (PDF, EPUB, etc.) for a Thoth work. |
|
Publisher information for a Thoth imprint. |
|
Imprint information for a Thoth work. |
|
A single book record as returned by the Thoth GraphQL API |
Module Contents¶
- class thoth.thoth_models.ThothTitle(/, **data: Any)¶
Bases:
pydantic.BaseModelA title entry for a Thoth work.
- model_config¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- title_id: str = ''¶
- locale_code: str = ''¶
- full_title: str = ''¶
- title: str = ''¶
- subtitle: str = ''¶
- canonical: bool = False¶
- class thoth.thoth_models.ThothAbstract(/, **data: Any)¶
Bases:
pydantic.BaseModelAn abstract entry for a Thoth work.
- model_config¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- abstract_id: str = ''¶
- locale_code: str = ''¶
- content: str = ''¶
- abstract_type: str = ''¶
- canonical: bool = False¶
- class thoth.thoth_models.ThothContribution(/, **data: Any)¶
Bases:
pydantic.BaseModelA contributor entry for a Thoth work.
- model_config¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- contribution_id: str = ''¶
- contribution_type: str = ''¶
- full_name: str = ''¶
- contribution_ordinal: int = 0¶
- class thoth.thoth_models.ThothSubject(/, **data: Any)¶
Bases:
pydantic.BaseModelA subject/keyword entry for a Thoth work.
- model_config¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- subject_id: str = ''¶
- subject_type: str = ''¶
- subject_code: str = ''¶
- subject_ordinal: int = 0¶
- class thoth.thoth_models.ThothPublication(/, **data: Any)¶
Bases:
pydantic.BaseModelA publication record (PDF, EPUB, etc.) for a Thoth work.
- model_config¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- publication_id: str = ''¶
- publication_type: str = ''¶
- isbn: str | None = None¶
- class thoth.thoth_models.ThothPublisher(/, **data: Any)¶
Bases:
pydantic.BaseModelPublisher information for a Thoth imprint.
- model_config¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- publisher_id: str = ''¶
- publisher_name: str = ''¶
- publisher_shortname: str = ''¶
- publisher_url: str = ''¶
- class thoth.thoth_models.ThothImprint(/, **data: Any)¶
Bases:
pydantic.BaseModelImprint information for a Thoth work.
- model_config¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- imprint_id: str = ''¶
- imprint_name: str = ''¶
- publisher: ThothPublisher | None = None¶
- class thoth.thoth_models.ThothBook(/, **data: Any)¶
Bases:
pydantic.BaseModelA single book record as returned by the Thoth GraphQL API
booksendpoint.The
booksendpoint usesWORK_LIST_FIELDS, which includes titles, abstracts, contributions, subjects, and imprint, but does not include thelicensefield (that requires fetching the full work viawork_by_id).Endpoint: POST https://api.thoth.pub/graphql Docs: https://api.thoth.pub
- model_config¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- work_id: str = ''¶
- work_type: str = ''¶
- work_status: str = ''¶
- doi: str | None = None¶
- publication_date: str | None = None¶
- place: str = ''¶
- updated_at: str = ''¶
- titles: list[ThothTitle] = []¶
- abstracts: list[ThothAbstract] = []¶
- contributions: list[ThothContribution] = []¶
- subjects: list[ThothSubject] = []¶
- publications: list[ThothPublication] = []¶
- imprint: ThothImprint | None = None¶
- canonical_title() str¶
Return the canonical full title, falling back to the first title.
- canonical_abstract() str¶
Return the canonical abstract content, falling back to the first.
- author_names() list[str]¶
Return author full names sorted by contribution ordinal.
- keyword_subjects() list[str]¶
Return KEYWORD-type subject codes (free-text keywords).
- property source_url: str¶
Return the DOI URL, or the Thoth work page as a fallback.
- property publisher_name: str¶
Return the publisher name from the imprint, if available.
- thoth.thoth_models.here¶