bib.bibtexparser.library¶
Classes¶
Library ¶
A collection of parsed bibtex blocks.
Source code in pybibtexer/bib/bibtexparser/library.py
Attributes¶
failed_blocks property ¶
All blocks that could not be parsed, preserving order of insertion.
Functions¶
add ¶
Add blocks to library.
The adding is key-safe, i.e., it is made sure that no duplicate keys are added. for the same type (i.e., String or Entry). Duplicates are silently replaced with a DuplicateKeyBlock.
:param blocks: Block or list of blocks to add. :param fail_on_duplicate_key: If True, raises ValueError if a block was replaced with a DuplicateKeyBlock.
Source code in pybibtexer/bib/bibtexparser/library.py
convert ¶
Convert the library to special library.
Convert the library to special library only contain block whose name is name, such as entry, 'string', ...
Source code in pybibtexer/bib/bibtexparser/library.py
remove ¶
Remove blocks from library.
:param blocks: Block or list of blocks to remove. :raises ValueError: If block is not in library.
Source code in pybibtexer/bib/bibtexparser/library.py
replace ¶
Replace a block with another block, at the same position.
:param old_block: Block to replace. :param new_block: Block to replace with. :param fail_on_duplicate_key: If False, adds a DuplicateKeyBlock if a block with new_block.key (other than old_block) already exists. :raises ValueError: If old_block is not in library or if fail_on_duplicate_key is True and a block with new_block.key (other than old_block) already exists.