CrossRefOrcid.update_references¶
- CrossRefOrcid.update_references(orcid_id, work_types=None, recent_years=2, style='APA', file_path='README.md', heading='Recent publications', heading_level=3, heading_suffix=':', confirmation_required=True, verbose=False, raise_error=False)[source]¶
Updates the “Recent publications” section in a Markdown file with a new list of citations.
- Parameters:
orcid_id (str) – ORCID iD of the researcher.
work_types (str | list | None) – Work type(s) to include; defaults to
None
.recent_years (int) – Number of recent years to include; defaults to
2
.style (str) – The citation style to use; defaults to
'APA'
.file_path (str) – Path to the Markdown file; defaults to
"README.md"
.heading_level (int) – The level of the heading under which the contents are to be updated; defaults to
3
.heading (str) – The Markdown heading for the references section; defaults to
"Recent publications"
.heading_suffix (str | None) – Suffix to the
heading
; defaults to":"
.confirmation_required (bool) – Whether to prompt for confirmation before proceeding; defaults to
True
.verbose (bool) – If
True
, prints status messages; defaults toFalse
.raise_error (bool) – Whether to raise the provided exception; if
raise_error=False
(default), the error will be suppressed.
Examples:
>>> from pyhelpers.ops import CrossRefOrcid >>> co = CrossRefOrcid() >>> orcid_id = '0000-0002-6502-9934' >>> co.update_references(orcid_id, verbose=True) To write/update references in README.md ? [No]|Yes: yes Updating "Recent publications" in README.md ... Done. >>> co.update_references(orcid_id, recent_years=5, verbose=True) To write/update references in README.md ? [No]|Yes: yes Updating "Recent publications" in README.md ... Done.