bibble.files.path_writer

See EOF for license/metadata/notes as applicable

Type Aliases

Entry

Classes

PathWriter

Relativize library paths back to strings

Module Contents

bibble.files.path_writer.Entry: TypeAlias = model.Entry
class bibble.files.path_writer.PathWriter(*, lib_root=None, **kwargs)[source]

Bases: bibble.util.middlecore.IdenBlockMiddleware

Relativize library paths back to strings

Can suppress errors from certain path roots on relativize, using MetaBlock data: MetaBlock(PathWriter.SuppressKey=[pl.Path()…])

Parameters:

lib_root (jgdv.Maybe[pathlib.Path])

_suppress_relative_fail(val) <Unknown>[source]
Parameters:

val (pathlib.Path)

Return type:

bool

field_h(field, entry) <Unknown>[source]
Parameters:
  • field (Field)

  • entry (Entry)

handle_meta_entry(library) <Unknown>[source]

An optional entry hook for middlewares, which is given the library’s metablock before transform is called.

Use case: conditionally setting PathWriter suppress paths

Parameters:

library (bibtexparser.library.Library)

on_write() <Unknown>[source]
transform_Entry(entry, library) <Unknown>[source]
Parameters:
  • entry (Entry)

  • library (bibtexparser.library.Library)

SuppressKey = 'PathWriter.suppress'
_lib_root = None
_suppress_in: list[pathlib.Path]
_whitelist = ('file',)