bibble._interface
Type Aliases
Enums
A Flag for where middlewares can be in the read/write stack |
Protocols
Middleware that looks up defined transforms using the type name, by mro. |
|
A Single middleware that holds the logic for reading and writing, |
|
A (non-adaptive) block middleware has 'transform_x' methods |
|
Writers can be Visitors, in which case they call ths visit method on |
|
For middlewares that depend on a middleware to be able to work themselves. |
|
A whitelist based test for middlewares. |
|
The protocol util.FieldMatcher_m relies on |
|
The core methods of a library |
|
A Middleware is something with a 'transform' method |
|
Protocol for both storing both read and write middlewares |
|
Protocol for signifying a middleware is for use on parsing bibtex to |
|
Readers take source text, or a file, or a directory, |
|
Describes the StringTransform_m |
|
Protocol for signifying middleware is for use on writing data to bibtex |
|
Writers take a library, format it, and write it to a file. |
Module Contents
- bibble._interface.StringBlock: TypeAlias = model.String
- class bibble._interface.Capability_f(*args, **kwds)[source]
Bases:
enum.FlagA Flag for where middlewares can be in the read/write stack
- dependent
- insist_end
- insist_front
- read_time
- report
- transform
- validate
- write_time
- class bibble._interface.AdaptiveMiddleware_p[source]
Bases:
ProtocolMiddleware that looks up defined transforms using the type name, by mro. The form for method lookup is either: - transform_{type(block).__class__} - {direction}_transform_{type(block).__class__}
An adaptive middleware doesn’t need all the ‘transform_X’ methods a BlockMiddleware_p does.
- class bibble._interface.BidirectionalMiddleware_p[source]
Bases:
ProtocolA Single middleware that holds the logic for reading and writing, Intended for undoing what is done on read, prior to writing.
eg: Latex Decoding, then Encoding
- class bibble._interface.BlockMiddleware_p[source]
Bases:
ProtocolA (non-adaptive) block middleware has ‘transform_x’ methods
- class bibble._interface.CustomWriteBlock_p[source]
Bases:
ProtocolWriters can be Visitors, in which case they call ths visit method on blocks
- class bibble._interface.DependentMiddleware_p[source]
Bases:
ProtocolFor middlewares that depend on a middleware to be able to work themselves.
eg: metadata applicator requires path reader
- class bibble._interface.EntrySkipper_p[source]
Bases:
ProtocolA whitelist based test for middlewares. Middleware’s set their skiplist on init, and can call ‘should_skip_entry’ when transforming blocks
eg: for only processing type=’article’ entries, not books
- class bibble._interface.FieldMatcher_p[source]
Bases:
ProtocolThe protocol util.FieldMatcher_m relies on
A Middleware with the FieldMatcher_m mixin will call the implemented field_h on each field that matches in an entry.
- class bibble._interface.Library_p[source]
Bases:
ProtocolThe core methods of a library
- class bibble._interface.Middleware_p[source]
Bases:
ProtocolA Middleware is something with a ‘transform’ method
- class bibble._interface.PairStack_p[source]
Bases:
ProtocolProtocol for both storing both read and write middlewares
- class bibble._interface.ReadTime_p[source]
Bases:
ProtocolProtocol for signifying a middleware is for use on parsing bibtex to data
- class bibble._interface.Reader_p[source]
Bases:
ProtocolReaders take source text, or a file, or a directory, parses the read bibtex, running middlewares on the parsed bibtex
- read(
- source,
- *,
- into=None,
- append=None,
- Parameters:
source (str | pathlib.Path)
into (jgdv.Maybe[bibtexparser.library.Library])
append (jgdv.Maybe[list[Middleware]])
- Return type:
jgdv.Maybe[bibtexparser.library.Library]
- read_dir(
- source,
- *,
- ext,
- into=None,
- append=None,
- Parameters:
source (pathlib.Path)
ext (str)
into (jgdv.Maybe[bibtexparser.library.Library])
append (jgdv.Maybe[list[Middleware]])
- Return type:
jgdv.Maybe[bibtexparser.library.Library]
- class bibble._interface.StrTransformer_p[source]
Bases:
ProtocolDescribes the StringTransform_m
- class bibble._interface.WriteTime_p[source]
Bases:
ProtocolProtocol for signifying middleware is for use on writing data to bibtex
- class bibble._interface.Writer_p[source]
Bases:
ProtocolWriters take a library, format it, and write it to a file. typically it formats as bibtex, but doesn’t have to. (eg: RstWriter)
- write(
- library,
- *,
- file=None,
- append=None,
- Parameters:
library (bibtexparser.library.Library)
file (jgdv.Maybe[pathlib.Path])
append (jgdv.Maybe[list[Middleware]])
- Return type: