Skip to content

Building 70 Projects ranging from beginner to advanced so anyone can — learn from, build upon, use as a reference, or even copy directly. Owned by my cybersecurity company 👇

512 B
Raw Blame
"""
©AngelaMos | 2026
base.py
"""


from typing import Protocol

from dlp_scanner.models import TextChunk


class Extractor(Protocol):
    """
    Protocol for text extraction from different file formats
    """
    def extract(self, path: str) -> list[TextChunk]:
        """
        Extract text chunks from a file at the given path
        """
        ...

    @property
    def supported_extensions(self) -> frozenset[str]:
        """
        File extensions this extractor handles
        """
        ...