papis-extract/papis_extract/extractors/__init__.py
Marty Oehme 8093259551
refactor: Remove pymupdf coupling in extraction
The library is only needed for pdf extraction which is taken care of
in its own extractor plugin. In the overall extraction routine we do not
need any knowledge of the existence of pymupdf.
2024-06-14 14:59:39 +02:00

28 lines
711 B
Python

from importlib.util import find_spec
import papis.logging
from papis_extract.extraction import Extractor
from papis_extract.extractors import pdf
from papis_extract.extractors.pocketbook import PocketBookExtractor
logger = papis.logging.get_logger(__name__)
all_extractors: dict[str, Extractor] = {}
all_extractors["pdf"] = pdf.PdfExtractor()
if find_spec("bs4") and find_spec("magic"):
all_extractors["pocketbook"] = PocketBookExtractor()
else:
logger.debug("pocketbook extractor not activated.")
class ExtractionError(Exception):
"""Raised for exceptions during extraction.
Something went wrong during the extraction process in the extractor
run routine itself.
"""
pass