Skip to content

publication

url_validator = pydantic.TypeAdapter(pydantic.HttpUrl) module-attribute

BasePublicationEntry

Bases: BaseEntry

authors = pydantic.Field(description='You can bold your name with **double asterisks**.', examples=[['John Doe', '**Jane Smith**', 'Bob Johnson']]) class-attribute instance-attribute

doi = pydantic.Field(default=None, description='The DOI (Digital Object Identifier). If provided, it will be used as the link instead of the URL.', examples=['10.48550/arXiv.2310.03138'], pattern='\\b10\\..*') class-attribute instance-attribute

doi_url cached property

Generate DOI URL from DOI identifier.

Why

DOI identifiers need https://doi.org/ prefix for linking. Property generates complete URL from DOI string.

Returns:

  • str | None

    Complete DOI URL, or None if no DOI provided.

entry_type_in_snake_case cached property

journal = pydantic.Field(default=None, description='The journal, conference, or venue where it was published.', examples=['Nature', 'IEEE Conference on Computer Vision', 'arXiv preprint']) class-attribute instance-attribute

model_config = pydantic.ConfigDict(json_schema_extra={'description': None}) class-attribute instance-attribute

summary = pydantic.Field(default=None, examples=['This paper presents a new method for computer vision.']) class-attribute instance-attribute

title = pydantic.Field(examples=['Deep Learning for Computer Vision', 'Advances in Quantum Computing']) class-attribute instance-attribute

url = pydantic.Field(default=None, description='A URL link to the publication. Ignored if DOI is provided.') class-attribute instance-attribute

ignore_url_if_doi_is_given()

Prioritize DOI over custom URL when both provided.

Why

DOI is canonical, stable identifier for publications. When provided, ignore user's URL to ensure templates use official DOI link.

Returns:

  • Self

    Publication instance with url cleared if DOI exists.

Source code in src/rendercv/schema/models/cv/entries/publication.py
@pydantic.model_validator(mode="after")
def ignore_url_if_doi_is_given(self) -> Self:
    """Prioritize DOI over custom URL when both provided.

    Why:
        DOI is canonical, stable identifier for publications. When provided,
        ignore user's URL to ensure templates use official DOI link.

    Returns:
        Publication instance with url cleared if DOI exists.
    """
    doi_is_provided = self.doi is not None

    if doi_is_provided:
        self.url = None

    return self

validate_doi_url()

Validate generated DOI URL is well-formed.

Why

DOI URL generation from DOI string might produce invalid URLs. Post-validation ensures generated URLs are valid.

Returns:

  • Self

    Validated publication instance.

Source code in src/rendercv/schema/models/cv/entries/publication.py
@pydantic.model_validator(mode="after")
def validate_doi_url(self) -> Self:
    """Validate generated DOI URL is well-formed.

    Why:
        DOI URL generation from DOI string might produce invalid URLs.
        Post-validation ensures generated URLs are valid.

    Returns:
        Validated publication instance.
    """
    if self.doi_url:
        url_validator.validate_strings(self.doi_url)

    return self

PublicationEntry

Bases: BaseEntryWithDate, BasePublicationEntry

authors = pydantic.Field(description='You can bold your name with **double asterisks**.', examples=[['John Doe', '**Jane Smith**', 'Bob Johnson']]) class-attribute instance-attribute

date = pydantic.Field(default=None, description="The date of this event in YYYY-MM-DD, YYYY-MM, or YYYY format, or any custom text like 'Fall 2023'. Use this for single-day or imprecise dates. For date ranges, use `start_date` and `end_date` instead.", examples=['2020-09-24', '2020-09', '2020', 'Fall 2023', 'Summer 2020']) class-attribute instance-attribute

doi = pydantic.Field(default=None, description='The DOI (Digital Object Identifier). If provided, it will be used as the link instead of the URL.', examples=['10.48550/arXiv.2310.03138'], pattern='\\b10\\..*') class-attribute instance-attribute

doi_url cached property

Generate DOI URL from DOI identifier.

Why

DOI identifiers need https://doi.org/ prefix for linking. Property generates complete URL from DOI string.

Returns:

  • str | None

    Complete DOI URL, or None if no DOI provided.

entry_type_in_snake_case cached property

journal = pydantic.Field(default=None, description='The journal, conference, or venue where it was published.', examples=['Nature', 'IEEE Conference on Computer Vision', 'arXiv preprint']) class-attribute instance-attribute

model_config = pydantic.ConfigDict(json_schema_extra={'description': None}) class-attribute instance-attribute

summary = pydantic.Field(default=None, examples=['This paper presents a new method for computer vision.']) class-attribute instance-attribute

title = pydantic.Field(examples=['Deep Learning for Computer Vision', 'Advances in Quantum Computing']) class-attribute instance-attribute

url = pydantic.Field(default=None, description='A URL link to the publication. Ignored if DOI is provided.') class-attribute instance-attribute

ignore_url_if_doi_is_given()

Prioritize DOI over custom URL when both provided.

Why

DOI is canonical, stable identifier for publications. When provided, ignore user's URL to ensure templates use official DOI link.

Returns:

  • Self

    Publication instance with url cleared if DOI exists.

Source code in src/rendercv/schema/models/cv/entries/publication.py
@pydantic.model_validator(mode="after")
def ignore_url_if_doi_is_given(self) -> Self:
    """Prioritize DOI over custom URL when both provided.

    Why:
        DOI is canonical, stable identifier for publications. When provided,
        ignore user's URL to ensure templates use official DOI link.

    Returns:
        Publication instance with url cleared if DOI exists.
    """
    doi_is_provided = self.doi is not None

    if doi_is_provided:
        self.url = None

    return self

validate_doi_url()

Validate generated DOI URL is well-formed.

Why

DOI URL generation from DOI string might produce invalid URLs. Post-validation ensures generated URLs are valid.

Returns:

  • Self

    Validated publication instance.

Source code in src/rendercv/schema/models/cv/entries/publication.py
@pydantic.model_validator(mode="after")
def validate_doi_url(self) -> Self:
    """Validate generated DOI URL is well-formed.

    Why:
        DOI URL generation from DOI string might produce invalid URLs.
        Post-validation ensures generated URLs are valid.

    Returns:
        Validated publication instance.
    """
    if self.doi_url:
        url_validator.validate_strings(self.doi_url)

    return self