Skip to content

bib.bibtexparser.middlewares.block.entry_fields_keep

Classes

KeepFieldsInEntry

KeepFieldsInEntry(
    entry_type,
    keep_field_keys,
    allow_inplace_modification=True,
)

Bases: BlockMiddleware

Keep the fields of an entry according to a custom list of field keys provided by user.

Source code in pybibtexer/bib/bibtexparser/middlewares/block/entry_fields_keep.py
def __init__(self, entry_type: str, keep_field_keys: list[str], allow_inplace_modification: bool = True):
    super().__init__(allow_inplace_modification=allow_inplace_modification, allow_parallel_execution=True)

    self.entry_type = entry_type
    self.keep_field_keys = keep_field_keys