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