papis-extract/papis_extract
Marty Oehme 765de505bb
refactor: Remove AnnotatedDocument class
The AnnotatedDocument class was, essentially, a simple tuple of a document
and a list of annotations. While not bad in a vacuum, it is unwieldy and
passing this around instead of a document, annotations, or both where
necessary is more restrictive and frankly unnecessary.

This commit removes the data class and any instances of its use. Instead,
we now pass the individual components around to anything that needs them.
This also frees us up to pass only annotations around for example.

We also do not iterate through the selected papis documents to work on
in each exporter anymore (since we only pass a single document), but
in the main function itself. This leads to less duplication and makes
the overall run function the overall single source of iteration through
selected documents. Everything else only knows about a single document -
the one it is operating on - which seems much neater.

For now, it does not change much, but should make later work on extra
exporters or extractors easier.
2024-01-20 16:36:24 +01:00
..
__init__.py refactor: Remove AnnotatedDocument class 2024-01-20 16:36:24 +01:00
annotation.py refactor: Remove AnnotatedDocument class 2024-01-20 16:36:24 +01:00
exporter.py refactor: Remove AnnotatedDocument class 2024-01-20 16:36:24 +01:00
extractor.py refactor: Remove AnnotatedDocument class 2024-01-20 16:36:24 +01:00
formatter.py refactor: Remove AnnotatedDocument class 2024-01-20 16:36:24 +01:00