bibble.util.selectors

Classes

SelectAuthor

TODO select entries by a set of authors

SelectEntriesByType

Select entries of a particular type

SelectN

Select N random entries

SelectTags

Select entries of with a particular tag

Module Contents

class bibble.util.selectors.SelectAuthor(*, authors)[source]

Bases: bibtexparser.middlewares.middleware.LibraryMiddleware

TODO select entries by a set of authors

should run name split on them

Parameters:

authors (collections.abc.Iterable[str])

abstractmethod transform(library) <Unknown>[source]

Transform a library.

Parameters:

library – Library to transform.

Returns:

Transformed library. If the library should not be modified, return a copy of the original library. The returned library has to be a new instance, except if self.allow_inplace_modification is True (in which case the library may also return the original library).

_targets: set[str]
class bibble.util.selectors.SelectEntriesByType(*, targets=None)[source]

Bases: bibtexparser.middlewares.middleware.LibraryMiddleware

Select entries of a particular type

Parameters:

targets (jgdv.Maybe[collections.abc.Iterable[str]])

transform(library) <Unknown>[source]

Transform a library.

Parameters:

library – Library to transform.

Returns:

Transformed library. If the library should not be modified, return a copy of the original library. The returned library has to be a new instance, except if self.allow_inplace_modification is True (in which case the library may also return the original library).

_entry_targets: list[str]
default_targets = ('article',)
class bibble.util.selectors.SelectN(*, count=1)[source]

Bases: bibtexparser.middlewares.middleware.LibraryMiddleware

Select N random entries

Parameters:

count (int)

transform(library) <Unknown>[source]

Transform a library.

Parameters:

library – Library to transform.

Returns:

Transformed library. If the library should not be modified, return a copy of the original library. The returned library has to be a new instance, except if self.allow_inplace_modification is True (in which case the library may also return the original library).

_count = 1
class bibble.util.selectors.SelectTags(*, tags)[source]

Bases: bibtexparser.middlewares.middleware.LibraryMiddleware

Select entries of with a particular tag

Parameters:

tags (collections.abc.Iterable[str])

transform(library) <Unknown>[source]

Transform a library.

Parameters:

library (bibtexparser.libary.Library) – Library to transform.

Returns:

Transformed library. If the library should not be modified, return a copy of the original library. The returned library has to be a new instance, except if self.allow_inplace_modification is True (in which case the library may also return the original library).

Return type:

bibtexparser.libary.Library

_targets: set[str]