Python examples that may help you create clean arch

Understanding Enum, Factory, and interfaces

class Journal(Enum):
    journal_a = auto()
    journal_b = auto()
    journal_c = auto()

    def from_str(journal_name: str) -> Journal:
        if journal_name not in Journal.__members__:
            raise ValueError(f"{journal_name} has not been implemented")
        return Journal.__members__[journal_name]

class Parser:
    def parse_html(document: str) -> BeautifulSoup:
        return BeautifulSoup(xml, "html.parser")

    def extract_figures(self, raw_http_document: str) -> List[Figure]:
        raise NotImplementedError

    def extract_document(self, raw_http_document: str) -> Document:
        raise NotImplementedError

    def from_journal(journal: Journal) -> Parser:
        match journal:
            case Journal.journal_a:
                return JournalAParser(
            case _:
                raise NotImplementedError