Citation
Citation
class CitationA scientific reference with explanations of its relevance to a computation.
Fields are read-only. Reasons and description may contain Markdown.
Attributes
| Name | Description |
|---|---|
bibtex |
The ready-to-export BibTeX entry. |
description |
A description of the citation, optionally formatted as Markdown. |
id |
The stable identity of the citation, preferably a DOI or arXiv ID. |
reasons |
The reasons for including this citation, optionally formatted as Markdown. |
reference |
The human-readable bibliographic reference. |
relevance |
The relevance score, or None if unknown. |
bibtex
Citation.bibtex: strThe ready-to-export BibTeX entry.
description
Citation.description: strA description of the citation, optionally formatted as Markdown.
id
Citation.id: strThe stable identity of the citation, preferably a DOI or arXiv ID.
reasons
Citation.reasons: list[str]The reasons for including this citation, optionally formatted as Markdown.
reference
Citation.reference: strThe human-readable bibliographic reference.
relevance
Citation.relevance: int | NoneThe relevance score, or None if unknown.
Methods
| Name | Description |
|---|---|
__new__ |
Create a citation |
__repr__ |
Return a compact representation suitable for lists of citations. |
__str__ |
Display the reference, identifier, description, reasons and known relevance. |
_repr_html_ |
Display an HTML report, with description and reasons as escaped text. |
_repr_markdown_ |
|
_repr_pretty_ |
|
to_bibtex |
Return the original BibTeX entry unchanged, ready to write to a .bib file. |
to_markdown |
Return a Markdown report, optionally including a fenced BibTeX entry. |
__new__
Citation.__new__(
id: str,
reference: str,
bibtex: str,
*,
reasons: Sequence[str] = (),
description: str = '',
relevance: int | None = None,
) -> CitationCreate a citation. Relevance is a nonnegative library-defined score.
__repr__
Citation.__repr__() -> strReturn a compact representation suitable for lists of citations.
__str__
Citation.__str__() -> strDisplay the reference, identifier, description, reasons and known relevance.
_repr_html_
Citation._repr_html_() -> strDisplay an HTML report, with description and reasons as escaped text.
_repr_markdown_
Citation._repr_markdown_() -> str_repr_pretty_
Citation._repr_pretty_(pretty: Any, cycle: bool) -> Noneto_bibtex
Citation.to_bibtex() -> strReturn the original BibTeX entry unchanged, ready to write to a .bib file.
to_markdown
Citation.to_markdown(include_bibtex: bool = False) -> strReturn a Markdown report, optionally including a fenced BibTeX entry.