swh.web.utils.citation module#
- swh.web.utils.citation.get_bibtex_from_origin(origin_url: str) Citation [source]#
Get citation in BibTeX format given a software origin, from found intrinsic citation metadata in the repository, i.e. original codemeta.json and citation.cff, for the latest visit snapshot main branch root directory.
- Parameters:
origin_url – origin url
- Returns:
the software citation in BibTeX format
- Raises:
swh.web.utils.exc.NotFoundExc – when snapshot, branch or directory is missing, no metadata could be found or the metadata files could not be decoded
BadInputExc – when the origin does not allow to find metadata
- swh.web.utils.citation.get_bibtex_from_swhid(target_swhid: str) Citation [source]#
Get citation in BibTeX format given a SWHID, from found intrinsic citation metadata in the repository, i.e. original codemeta.json and citation.cff, for the target object.
- Parameters:
target_swhid – SWHID which can be qualified or not, if the target object is of type Content, it must be qualified with an anchor
- Returns:
the software citation in BibTeX format
- Raises:
swh.web.utils.exc.NotFoundExc – when snapshot, branch or directory is missing, no metadata could be found or the metadata files could not be decoded
BadInputExc – when the origin does not allow to find metadata