jabref2obsidian.cite.param_assemble#

jabref2obsidian.cite.param_assemble(entry: dict) list[source]#

Assembles the parameters from a dictionary of bibtex entry to be passed in citation or citation_full functions.

Note

citation or citation_full functions are converted from the JavaScript functions I developed before. They can generates brief and full versions of citation text. However, the citation text presented here is only for adding brief literature citations referenced to this note in another Obsidian note, not for formal academic papers.

Parameters:

entry (dict) –

A a bibtex entry from which the parameters will be extracted. For example:

import bibtexparser

bib_path = '/Users/kirov/Library/Mobile Documents/iCloud~com~apple~iBooks/Documents/Knowledge.bib'
with open(bib_path) as bibtex_file:
    bib_database = bibtexparser.load(bibtex_file)

entry = bib_database.entries[1]
param_assemble(entry)

Returns:

  • list – A list of publication parameters extracted from the bibtex entry, in the order of [‘ENTRYTYPE’, ‘ID’, ‘author’, ‘title’, ‘editor’, ‘edition’, ‘container’, ‘publisher’, ‘school’, ‘address’, ‘year’, ‘volume’, ‘number’, ‘pages’].

  • None

Examples

entry = {
    'ENTRYTYPE': 'book',
    'ID': 'Book1',
    'author': 'John Smith',
    'title': 'My Book',
    'publisher': 'My Publisher',
    'year': '2021',
}
param_list = param_assemble(entry)
print(param_list)
['book', 'Book1', 'John Smith', 'My Book', '', '', '', 'My Publisher', '', '', '2021', '', '', '']