Source code for faker_file.providers.base.text_extractor
from pathlib import Path
from typing import Union
__author__ = "Artur Barseghyan <artur.barseghyan@gmail.com>"
__copyright__ = "2022-2023 Artur Barseghyan"
__license__ = "MIT"
__all__ = ("BaseTextExtractor",)
[docs]class BaseTextExtractor:
"""Base text extractor."""
path: str
def __init__(
self: "BaseTextExtractor",
**kwargs,
) -> None:
"""Constructor.
:param kwargs: Dictionary with parameters (for text extractor
specific tuning).
"""
self.handle_kwargs(**kwargs)
[docs] def extract(
self: "BaseTextExtractor",
source_file: Union[Path, str],
) -> str:
raise NotImplementedError("Method `extract` is not implemented.")