Skip to content

references

tit.reporting.references

The citations TI-Toolbox reports use, as data: one dict per paper.

key is the stable id a generator cites by, label the visible tag ([Puonti2020]), citation the text and doi the link. tit.reporting.qc_rules cites rules by DOI, and every such DOI must be here (tests/test_reporting_dti_qc.py). Pages collect what they cite with :class:tit.reporting.html.components.Cites, so a page lists only what it cites; an entry no report cites is deleted.

get_reference_by_key

get_reference_by_key(key: str) -> dict[str, str] | None

The reference with this stable key or visible label (any case), or None.

Source code in tit/reporting/references.py
def get_reference_by_key(key: str) -> dict[str, str] | None:
    """The reference with this stable key or visible label (any case), or ``None``."""
    k = str(key).strip().lower()
    return next(
        (
            ref.copy()
            for ref in DEFAULT_REFERENCES
            if k in (ref["key"].lower(), ref.get("label", "").lower())
        ),
        None,
    )

get_reference_by_doi

get_reference_by_doi(doi: str) -> dict | None

The reference with this DOI, or None.

Source code in tit/reporting/references.py
def get_reference_by_doi(doi: str) -> dict | None:
    """The reference with this DOI, or ``None``."""
    return next(
        (ref.copy() for ref in DEFAULT_REFERENCES if ref.get("doi") == doi), None
    )